- Home /
Question by
kristant18 · Dec 10, 2018 at 08:30 PM ·
timewindzone
How to enable windzone for a specific time interval
Hello! I am new to unity and just cannot find a way on how to enable a windzone for a specific time interval... (i have got the same problem for the lens flare effect and rain - but maybe i can figure out the rest on my own if i manage to do just one of them right) I am grateful for every piece of advice!
Comment
Answer by Cornelis-de-Jager · Dec 10, 2018 at 09:38 PM
You can use co-routines to do delayed events;
void EnableWindZone (float windZoneTime) {
windzone.enabled = true;
StartCoroutine (DisableWindZone (windZoneTime));
}
IEnumerator DisableWindZone (float windZoneTime) {
yield return new WaitForSeconds(windZoneTime);
windzone.enabled = false;
}
Your answer
Follow this Question
Related Questions
deltatime glitches 1 Answer
Fade in AudioLister over time #c 1 Answer
slow a lerp ? array/static problem 1 Answer
Move a keyframe in time only 1 Answer
Jump with mathf.lerp problem 2 Answers