Search Unity

Question Inconsistent documentation OnAnimatorMove

Discussion in 'Animation' started by Disastorm, Jan 18, 2023.

  1. Disastorm

    Disastorm

    Joined:
    Jun 16, 2013
    Posts:
    132
    *edit i think I figured it out. OnAnimatorMove can actually be called either inside or outside of the Physics Step based on the animation Update Mode selected ( https://docs.unity3d.com/ScriptReference/AnimatorUpdateMode.html ) .

    Original Post is below:

    Hello, does anyone know which of these is correct?

    https://docs.unity3d.com/2022.2/Documentation/ScriptReference/MonoBehaviour.OnAnimatorMove.html

    this claims OnAnimatorMove is called every frame and has an example using Time.deltaTime.

    https://docs.unity3d.com/2022.2/Documentation/Manual/ExecutionOrder.html

    This shows OnAnimatorMove is called inside the Physics Step which can be called multiple times per frame, or even 0 times per frame since its a fixed time step. And also explicitly says functions running in the Fixed Update should not use Time.deltaTime. Now I know OnAnimatorMove is not FixedUpdate, but its supposedly part of the same Physics Step so you'd think the same would apply. However in the animation section this also once again says OnAnimatorMove is called every frame, so it's a bit confusing to me.


    So does anyone know if deltaTime is something that should actually be used in this function, and how often this function is actually called?
     
    Last edited: Jan 18, 2023