As the Scripting API said, Animator.bodyPosition is:
The position of the body center of mass.
The position is in worldspace. You should only set this value from within an OnAnimatorIK() function call.
I have a character model with a Z-axis moving animation, when I tried to log bodyPosition, I meet some problems.
Here are the settings and the result:
There are some questions:
- When get in OnAnimatorMove(), the bodyPosition is not the same, and not in worldspace, why?
- The Animator.Root T curve is the animator.bodyPosition, and the Animator.Root Q curve is the animator.bodyRotation?
- Why the bodyPosition is not correct at first frame of the game?
Soā¦does anyone knows what is the real magic inside the animator.bodyPosition?
AND how to calculate the root motion by center of mass and body orientation?