Hi guys, sorry if this is hard to explain.
I have the following code
var checkpoint : Transform; var checkpoint2 : GameObject; function Awake () { transform.position = checkpoint.position; transform.rotation = checkpoint.rotation; }
checkpoint is a spawn location, within my game. i have to manually add the prefab/empty object as the spawn location (click and drag into the variable box).
I would like to automatically change that variable, with a different prefab/empty object. This would allow a new spawn location, where ever the new/second prefab is located.
Problem is, you cant Mix a gameobject with a transform.
How can i overcome this?
Surely if i can manually add a prefab into the variable, i should be able to change that variable with another prefab, automatically.
Thankyou
Edit: I would like to make “checkpoint2” the new variable within “Checkpoint”