How to use attack & dodge animations without root motion

Hello,
I’m trying to use attacks animations and dodge animations without root motion on my third person project, but I’m running into some trouble. If I do not enable root motion for my animations, the camera will not follow the character and after the animations is finished, my character just slides back to the root. If you have a solution, please let me know.

Thank you!

Hey @ArcReed3215! Welcome to the forums!

So if you do not want to use root motion for your animations, you need to move your root somehow. What you can do is when the animation plays, set your Character movement component’s max speed to a higher amount at the beginning and lower it at the end. :slight_smile: Otherwise you may want to use root motion, but that can be a whole rabbit hole if the animations’ root movements aren’t solid.

You can try to enable “Force Root Lock” inside your animation sequence. It will force the root bone to be in one place. Leave the root motion enabled.

Just to lend a hand, here’s a screenshot to show exactly where to find that. You’ll open the animation itself and it’s here.

Thanks for the help!
I gave it a try and it has the same effect as just enabling root motion. My dodge animation is a roll and it travels a lot further when root motion is disabled, but it has problems where the character is able to move freely and after the animation montage is finished, the character will slide back to the root. (The camera also doesn’t follow the character, it stays with the capsule component which means the capsule doesn’t move either) There’s nothing wrong with using the root motion for my roll animation, except that the distance is very short and the camera makes it feel like the character is rolling on a very rough surface. The camera vibrates making it feel like the surface is very rough.

I’m hoping there is a way to use the roll animation without root motion so the character not only moves a pretty distance, but also the camera follows and doesn’t shake. Again, really appreciate the help!

Thanks for the help!
I think I understand what you mean here. The thing is, if the axis value of “Move Forward / Backward” is equal to 0, then the character wouldn’t move at all. So setting the max speed on the character wouldn’t really do anything since the character won’t be moving. On the other hand if there is input on the “Move Forward / Backward” then this could possibly work and the animation would be able to play without root motion and errors.

I plan to get some better root motion attack and dodge animations so I don’t have to worry so much about the root motion not looking too good. Thanks for the suggestion, I will try to tweak your idea here and see if I can get it to work.

If you know some animation sets on the marketplace that has good root motion animations, please let me know!

Ah, I see. A lot of people getting mixed up in this. The definition of root motion is to animate the root bone itself which will drive the capsule component.

From your description, I can tell that your animation is using the pelvis bone to animate the character, am I right? It will never work for the root motion. There are a few ways to get around it, but the most recommended one is to re-edit your animation and move your root bone this time instead of the pelvis bone.

@Mind-Brain thank you for clarifying my point :smiling_face_with_three_hearts:

I know this is late, but I think I have the perfect solution to your problem. Which would be to simply modify the animation inside the Animation Sequence. Create a Key for the Root Bone at the beginning of the Animation, then go to the time where your character stops rolling and increase the Root bone as far as you want to go. As it is now it would be very janky so you’d need to smooth it out with cubic interpolation with the curve editor for the Rootbone that would’ve been automatically created after you added a keyframe.

This will definitely solve your problem but the animation may still look weird. In that case you’d need to find another animation. I mainly use this to extend the range on attack animations and it’s worked on every attack animation I’ve modified.