Change animation speed while running

Hi all,

Just wondering, is there a way to change the animation playrate while the animation is running?

p = self.salsas.actorInterval("dance", playRate = 1)

The animation lasts for 8 seconds. I want to have a variable playrate and change it accordingly while the animation is playing.

Is that possible?


I never tried it, but you can check this.

Actor.setPlayRate() will only affect the animation when it is playing due to a call to actor.loop() or, or some such direct call into the Actor. It can certainly be done while the animation is playing.

If you want to use an ActorInterval, that means the interval is in charge of the play rate, and setting the animation rate at runtime is not possible. (Though you could use interval.setT() to fiddle with the runtime instead of using interval.start()).

But it sounds like what you want is to use instead of an ActorInterval.


I used and it works as you said.

Thanks David.