The title pretty much sums it up. My enemy prefab is only being instantiated in the Y-axis but the coin prefab is being instantiated how I wanted it, even though they have both the same coordinates.
import System.Collections.Generic;
var enemyPrefab : GameObject;
var coinPrefab : GameObject;
public var Coinnumber = 1;
public var Coinnumberside : float = 0.0f;
function OnTriggerEnter(other: Collider)
{
if (other.tag == "Trigger" )
{
var StagePosition : Vector3;
StagePosition.z = 5.69 + Coinnumber;
StagePosition.x = 0.0 + Coinnumberside;
StagePosition.y = 0.4;
Instantiate(coinPrefab, StagePosition, Quaternion.identity);
Coinnumber = Coinnumber + Random.Range(5,10);
Coinnumberside = Coinnumberside + Random.Range(0.2,-0.4);
var EnemyPosition : Vector3;
EnemyPosition.z = 5.69 + Coinnumber;
EnemyPosition.x = 0.0 + Coinnumberside;
EnemyPosition.y = 0.4;
Instantiate(enemyPrefab, EnemyPosition, Quaternion.identity);
Coinnumber = Coinnumber + Random.Range(5,10);
Coinnumberside = Coinnumberside + Random.Range(0.2,-0.4);
}
}