- Home /
Player Spawn problems
hey guts i want the player to yield/(wait spawning) for 5 secondes an than play how do i do that?? thanks
Answer by JGeorge · Jan 25, 2011 at 04:00 PM
Use a Coroutine. It allows you to declare wait periods.
Answer by Borgo · Jan 25, 2011 at 04:01 PM
You can make something like this:
var isEnable : boolean = true;
function Update(){ if (isEnable){ //play } }
function SetEnableOnTime(sec : int){ yield WaitForSeconds(sec); isEnable = true; }
So, set isEnable = false when respawn and call SetEnableOnTime(5)... An observation: yield WaitForSeconds cannot be called inside Update function.
Your answer
Follow this Question
Related Questions
Add spawn to script [Multiplayer] 0 Answers
Spawn different Player models 0 Answers
how to make a character resume after going into a random battle? 1 Answer
player spawning 0 Answers
Spawn player if player dead 2 Answers