I have a working death function and it transforms me to the position but once i am there i cant move my first person controller. Help
function Death (){
if (maxHealth == 0)
playerObject.transform.position = spawnPoint.position;
}
I have a working death function and it transforms me to the position but once i am there i cant move my first person controller. Help
function Death (){
if (maxHealth == 0)
playerObject.transform.position = spawnPoint.position;
}
You need to reset the health, otherwise the Death() function will be called every frame again.
function Death (){
if (maxHealth == 0){
playerObject.transform.position = spawnPoint.position;
maxHealth = 100;
}
}
of course you can change the value 100 to anything you want, including a constant or a member variable.