Hello, I’ve been trying to spawn an object using Instantiate and place it on the location of an empty game object. Here is my script, it works fine but it instantiate the object at the center of the scene (I want to spawn the source object on the spawnPoints instead).
var source : GameObject;
public var spawnPoints : GameObject[];
function Start ()
{
var source = Instantiate(source, transform.position,transform.rotation);
}
I am getting the error "';' expected. Insert a semicolon at the end." On the line with Vector3 pos = spawnPoints[Random.Range(0, spawnPoints.Length)].transform.position;
– Tony_TWoopsie. Mixed C# with UnityScript. Fixed now
– FLASHDENMARKThanks, it's working perfectly !
– Tony_T