- Home /
Apply root motion to parent
I have an Animator attached as a child to its parent Player. The player can use a "dodge" move but this looks weird because the dodge jump varies in speed and height, but as the Animator is attached to the Player parent it does this "in-place". If i apply root motion to the Animator the character becomes off centered from the Player parent.
Can i somehow hook into the positions calculated by the "apply root motion" feature and apply this to the Player parent instead of the Animator?
Answer by Kale · Aug 26, 2015 at 12:38 PM
http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnAnimatorMove.html
This seems to be what you're looking for. Instead of transform, you can use the parent transform I'd guess.
Though, this is like 2 years old so you probably gave up or found out yourself, but since I was looking into it, I figured, in case i forget, I add it here.
Answer by Larb · Aug 27, 2015 at 06:51 AM
Haha thanks for the reply Kale! Im not even sure that callback existed back in 2013. The idea of moving the parent Player based on the animation movement was bad to begin with, because changes in the animation would also change the controls of the player (dodge distance/speed etc). Also baking Root transform position (y) in the animations inspector solved part of my problem. So it was a bit of a mix solution.
Cheers!
Your answer
![](https://koobas.hobune.stream/wayback/20220613104605im_/https://answers.unity.com/themes/thub/images/avi.jpg)