I’m trying to build a script so that the player respawns at a certain checkpoint when dead,
i got the first part:
var itemTracker;
itemTracker = GameObject.FindWithTag("GameController").GetComponent(GameStats);
function Update ()
{
if(itemTracker.playerLife < 1)
{
}
}
But i don’t know how to make it respawn at that point… any ideas? Or even if possible a fitting script?
Thanks in advance
Edit: the respawn points are stored as a number in a variable (also inside the itemTracker script)