i created a death zone and after the player trigger it the player respawn but after that the charater froze and the game still playing
my respawn-
var myvar = 1;
function Update ()
{
// check if your character fell off the platform
if(transform.position.y < -200)
{
transform.position.y = 17.06564;
transform.position.x = 28.76343;
transform.position.z = -279.9743;
}
}
my death zone and respawn -
function OnTriggerEnter (other : Collider)
{
// destroy all game objects that enter this area
Destroy(other.gameObject);
}
var spawnPoint: Transform;
function Awake ()
{
Spawn();
}
function Spawn ()
{
transform.position = spawnPoint.position;
}
function OnDeath ()
{
Spawn();
}
if this code doesnt work do anyone has any suggestion on how i can script it. im trying to create a death zone trigger that kills the player and respawn .