Archive 17/01/2023.

Animation Controller

Askhento

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)

Modanung

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

Askhento

You are a MAGICIAN!
Thank you!

Modanung

Dark wizard

Leith

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.

Askhento

Wow this one is more like BLACK MAGIC haha!

Modanung

Magic is the grey area. :wink:

Modanung

@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.

Leith

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.