- Home /
Is it possible to mix Root Motion and controller animations?
I have a good locomotion system set up using code to control the transform and it feels really good, but as I'm creating a 3D fighting game I need to also have some moves (such as attacks and grapples) to be controlled by root motion.
Is there any way to mix the two so I can keep my locomotion system but have everything else controlled by root motion?
Answer by Hyperion · Sep 01, 2013 at 04:26 AM
You're not being too specific, so I will also be a bit vague. In order to use root motion, your character needs to use Mecanim, and in order to access Mecanim from code (but not necessarily, so if you don't want to use Mecanim, skip to the OR part), you need to use a state machine. Therefore, configure your character for Mecanim either way (that is if it is a human, is it?), add an animation controller component (state machine) and check the 'Use Root Motion' box.
OR if you don't want to use Mecanim, you will want to confirm your animations as Legacy animations and use a state machine anyway (because statemachines are independent of Mecanim). If you have more questions, feel free to ask.
-Hyperion
Sorry I should have been more specific.
Yes I'm using $$anonymous$$ecanim for my characters. Here's where the issue exists though:
I have root animation checked and all my animations are then acting as root motion, so my locomotion system is then applying the motion from the animation to my movement. I don't want this. However, I need to use root animation for the actual moves because I don't want to have to animated the actual position of the characters in code at this point (like for instance for a hit reaction that sends the player backwards).
So what I'd ideally like is to not use root animation for my locomotion animations but use it for everything else.
Does this make sense?
I plan on using $$anonymous$$ecanim regardless of if it is root animation or otherwise.
Try using Animator.applyRoot$$anonymous$$otion=false when you're activating the locomotion, and vice versa when you're using a non-locomotion animation.
Excellent! Exactly the sort of thing I was looking for!
I'll give it a shot, thanks.
You're welcome. Also, if it works out, please accept my answer.
Your answer
Follow this Question
Related Questions
why Do my animations behave differently ? 0 Answers
Problem in Root Motion Animation . 0 Answers
Mecanim: Bake Only Z Root Motion Into Pose 0 Answers
How to respect colliders in Animations with Root Motion ? 1 Answer
Animations blending in weird way (maybe something to do with root motion?) 0 Answers