• Runtimes
  • How to pause at certain frame?

  • Изменено
Related Discussions
...

Hello,

How I can pause animation at certain point?

I saw old post about setting timeScale to 0f, but this isn't enough as I need to stop it at a certain point.
I found out addListener method with events, but from my understanding its about spine2d events, not events like 'timeUpdate' from html5.
Atm I got hard time figuring it out what's possible in yours Runtimes as I come from web development and making game is side hustle and dream. Found out I can, but maybe there is build in way that I'm missing:

setTimeout(() => {
   Animation.state.timeScale = 0;
, specifiedTime})

As you found, you can set the timeScale at a particular time. You may want to use TrackEntry trackTime rather than wall time.

Another way is to set TrackEntry trackEnd to a very high value, then set TrackEntry animationEnd to the time you want the animation to stop. Play the animation non-looping and it will play until the animationEnd time, then hold that pose just like it would if it reached the animation duration (which is what animationEnd defaults to).