I’m having problems with my gameobject spawn, what i want it to do is, when the game starts, it places the player in that position, but i keep on getting errors, whats wrong with my code?
var SpawnPoint : Transform;
var respawn : boolean = false;
var player : GameObject;
function Update () {
{
Application.loadedLevel(0);
transform.position(player) = SpawnPoint.position;
}
}
If you want your player to start at the SpawnPoint position at the very start of the game, then you shouldn’t set the position in the Update function.
The Update() function is called once every frame.
Set the position in the Start() function instead. The Start() function is only called once at the beginning of the scene.