- Home /
Changing rotation if not interupted
I need to change an object's rotation(x) and revert it back in 1.5sec if the rotation won't change again. I am using the yield WaitForSeconds(1.5);, and when i change the rotation the timer won't stop, reset, disable, anything, so even if i keep changing the rotation for every (let's say) 0.2sec, it starts causing problems after 1.5sec. I've fighted with it quite a long time now, looking forward for answers.
Comment
Answer by ScroodgeM · Jul 27, 2012 at 04:11 PM
instead of just calling coroutine make the following:
StopCoroutine("Rotator"); StartCoroutine("Rotator");
notice that method should me sent as string