- Home /
Question by
gamegirl1984 · Dec 05, 2014 at 03:27 AM ·
functionactiveset
how to: Set.Active False, then True, then False again?
How would I have this go true again after a certain amount of time?
var room : GameObject;
}
function start ()
room.SetActive(true);
function OnTriggerEnter (player : Collider){
if(player.tag == "Player")
yield WaitForSeconds(1.5); room.SetActive(false);
}
\\would another function update come in here?
Comment
Best Answer
Answer by g8minhquan · Dec 05, 2014 at 04:07 AM
You can yield WaitForSeconds(); as many times as you like. For example:
yield WaitForSeconds(1.5);
room.SetActive(false);
yield WaitForSeconds(1.5);
room.SetActive(true);
You should read more to understand Coroutines, it will be very helpful for you in long term. http://docs.unity3d.com/Manual/Coroutines.html
Your answer
Follow this Question
Related Questions
Why does my variable show a rising score AND 0 at the same time? 2 Answers
What are these things doing in C#? 3 Answers
Set a Bool Through Function 1 Answer
why can´t set value in own function? 1 Answer
SetActive(true) not working 2 Answers