Pause the game after animation is completed

Hello, everyone

(I’m using the new Unity UI system)

I have a little problem that i’m confused about how to actually get it working using the right code

I have a pause button attached to my scene, when i click the pause button it shows a pause menu that has an animation, now if i use Time.timeScale = 0 the animation won’t complete, so how i tell my scene to be paused after that animation has completed?

Any help i greatly appreciated

Thank you for your time.

1 Answer

1

It would be nice to see some code… However, I believe this will answer your question here.
This is in Javascript AKA (Unityscript)

yield WaitForSeconds (animation[“YourAnimationName”].length);

Hope that answered your question.