- Home /
Freezing Y position when using rootmotion
Hi, I'm making a combat system for a hack and slah game (imagine Devil May Cry), I am using rootmotion for the attack animation because I want the movement during attacks to look natural.
The problem is that when the animation plays the character gets lifted off the ground. I have looked at other answers about this problem but most of them just say to turn off root motion.
Is there a way to freeze the Y position of an animation while still using root motion?
Any help would be greatly appreciated.
I made a simple script to fix the problem, just raycast down and set the characters position to the hit point.
Answer by hexagonius · Sep 28, 2018 at 02:08 PM
it's possible to avoid y movement from the animation itself.it's called bake into pose and can be configured from the animation inspector:
https://docs.unity3d.com/Manual/RootMotion.html