Script Execution Order Settings not working for OnAnimatorMove() functions?

Hi everyone!!

My question is simple, are the OnAnimatorMove() functions of different scripts not handled by “Unity script execution order”?

I have several scripts with the On AnimatorMove() function and I need those functions to be executed in a certain order. So I’ve added those scripts to the “Unity script execution order” array and ordered them as I need.
However, even if the order between them changes, the call order of the OnAnimatorMove() functions does not match the order of the scripts in the “Unity script execution order” array.

I don’t know if it’s a bug or it just doesn’t work for these functions.
Can someone clarify my doubt?

I hope your help, a greeting and thanks in advance.

Interesting. The docs here:

Do not say explicitly that it works for OnAnimatorMove(), but pretty much implies that it should when it says other callbacks.

If you can strip it down to a small project and prove it runs out of order, keeping the timing diagram in mind, you might want to file a bug within Unity (Help → Report Bug).

Here is some timing diagram help:

1 Like

I have created a new HDRP project with just the example scene.

I have tried on a new scene creating two simple scripts and the execution order for the OnAnimatorMove() functions does not work, since the execution order system does work with other functions like Update etc. as can be seen in the images:

So it’s either a bug or simply that Unity doesn’t take into account the OnAnimatorMove() functions for the execution order of the scripts…
So I don’t know whether to report it as a bug, because I really don’t know if it’s a bug or that Unity has it like that.

Any suggestion?

If you’ve already made the new project, I would definitely report it as a bug, and include the snippet from the docs that implies all callbacks should be ordered.

Either Unity will fix it or they will say “as intended.”

I would also suggest posting on the dedicated Animation forum where you’re more likely to get an Animation dev.

Either that or I can move your post for you.

I’d be surprised if this were sorted by execution order because it’s not really something that would be execution order based AFAIK, it’s a notification of an event. No different than the physics callbacks. We don’t sort the order of them and I don’t see that being done for animation. I might be wrong because I’m not an Animation dev but I think this is an “event” callback and not really the same as “Update” or “FixedUpdate”.

1 Like

I see “Update”, FixedUpdate", “LateUpdate” and “OnRender” all MonoBehaviour things. The thing is, there’s a lot of code to look at here and it’s not exactly familiar to me.

1 Like

Thanks for the answers!

I would appreciate it if you moved it for me to the forum you suggest. Greetings