- Home /
Question by
TakisobieWax · Mar 21, 2021 at 06:50 PM ·
scripting beginner2d animation
How can i stop the animations for few seconds?
I've got a simple animation in my menu background(i created empytObject, add Image and i created animationController who moves the picture) and I would like the animation to play once every few seconds but how?
Comment
Answer by HappyPixel27 · Mar 21, 2021 at 06:57 PM
You can make a float that when that float reaches a certain number the animation will play. Something like this:
switch (timeUntilNextPlay) { case (the time you want the float to reach): Play your animation here; timeUntilNextPlay = 0f; break; default: timeUntilMinuteChange++; break; }