Blend (CrossFade) animator between 2 states when paused (speed = 0)

Let’s say I have a paused Animator (speed = 0) currently in state A. I want to put its position halfway between state A and state B.

If I wanted to do that over time, I could simply write:

animator.CrossFade("B", duration, layer);

But I want to do it instantly, while keeping the speed at 0. Basically, scrubbing between 2 states.
I tried the following and they didn’t work:

animator.CrossFade("B", 0, layer, 0.5f);
animator.CrossFade("B", 1, layer, 0.5f);

Any idea how to do it? Is it even possible?

This is not possible right now, there is no way to change transition timing from script.

You can emulate the same thing if you change a little bit your statemachine.
Rather than having two state with a transition, you can create a blend tree with your two motion and simply change the weight to emulate the transition.

Or you could use recording and play the whole transition and then switch to playback mode and adjust the timing like you want.

1 Like

Unfortunately this is for a plugin, so I can’t ask my users to change all their animator controllers.

The recording is interesting, but it’s limited to 2min45s at 60 FPS (10k frames). Still, it’s a very cool feature I had no idea existed. How’s the memory usage on it?

Is there no possible hack that you could think of? And if not, is this “feature” something that is planned at some point in the (not so remote) future?

If not, I guess I’ll just have to tell my users that animator recording/replaying/rewinding is limited to ~3mins.