- Home /
Question by
0_osmile0_o · Aug 07, 2014 at 09:29 PM ·
triggerdelaycountdownkill player
Killing the player in a trigger zone.
I need to restricts player's movement by killing him if he enters the trigger zone and stays there for too long (20 secs maybe). I know how to do the killing script and assign it to a trigger zone but I have no idea how to do the 20 second delay. The thing is that it has to restart each time a player leaves the zone and then enters it again. And right beore you die I need to play a sound.
function OnTriggerEnter (other : Collider) { Destroy(other.gameObject); }
Comment