Hello,
Currently in my game, I have the character respawning back to life in the exact same spot at the start of the game. But lets say the character makes it midway of the game and dies. How do I get the character to respawn midway of the game?
Here is the script Im currently using for character respawn.
private var StartPos : Vector3;
function Awake()
{
StartPos = transform.position;
}
function OnTriggerEnter(other : Collider)
{
if(other.gameObject.name == "fallout")
{
//RESPAWN!
HealthGui.LIVES -= 1;
StartPos.y += 4;
transform.position = StartPos;
}
}