Animation Controller

Hello guys, I have a quick question about AnimationController class. I understand some of the features in it and I am able to run looping animation with Play/PlayExclusive method. And for some reason I need to pause the animation, but when I call Stop it resets to the beginning! Is there any clever way to pause the animation?

Thanks for read this)

I assume you could simply set its speed to 0.0f. :thinking:

You are a MAGICIAN!
Thank you!

1 Like

Dark wizard

2 Likes

Don’t use speed - use Weight.
A weight of zero means animation will have no effect, so we don’t bother to calculate for it.
A speed of zero means we do all the same calculations based on the same time, every frame.
Pretty sure animation controller does NOT check for zero time.

1 Like

Wow this one is more like BLACK MAGIC haha!

Magic is the grey area. :wink:

2 Likes

@Leith But I recon with a weight of zero the animation would still progress. Also the pose would not be displayed when the weight is set to zero, which does not seem like @Askhento’s desired behaviour.

There’s code that checks for zero weight, an early out, which is not so for zero time, from what I saw… it’s used to stop interpolation when we blend weights, but basically, if weight hits zero, that part of the animation data is no longer considered - time on the other hand, matters not, it seems, to the animation system, it simply infers that the next frame is the current frame, and goes through all the effort to try to interpolate between now, and now, for no raison.