You would like to use scripts to control movements without using unity root motion but you have an animation with root motion. So, how do you remove bone motions in Unity Game Engine so that you have an animation with no root motion?
Here is how you do it!
In this tutorial, we will be using Forest wolf in this example. You can buy Forest Wolf here.
So we have a jump animation with root motion. What should we do? We need to remove the root bone motion in the animation. In most cases, it will be the hips/pelvis bone.
1. Look for Jump animation in the animation folder.
2. Expand Jump animation and look for the clip file.
3. Press 'control D' to duplicate it.
4. The duplicated Jump clip should appear in the same folder. Drag it to Forest Wolf's animator.
5. Now that it's in the animator. You can edit it. ( You might ask why I can't edit the original jump animation. You can't. The original animation is READ ONLY) To edit it, you will need to duplicate the clip. Drag Forest wolf prefab to the scene and select Forest wolf. Press 'control 6'. You should see the animation window pop up.
6. Select Jump animation( the one without READ ONLY) using the tab on the top left corner.
7. Scroll down and look for RigPelvis : Position. We are going to modify the position only. Not rotation and scale. This is because the position is the only one that's affecting the root position. Select the Animation Keys in between the first key and last key. Delete them. It might load a while when you click delete.
8. Next, we are going to check the animation curves to see if they are okay. Select the curves tab at the bottom of the window. You notice the Green curve is not straight. We need to make it straight so that the animation will look correct. To do that, Select the 2 green keys. Right click > Both tangents > Set to constant. The curve should become straight.
9. You are done! Now you have a new Jump animation with no root motion. And at the same time, You still have your original Jump animation. So if you ever want to use the original animation again, you can always do so!
10. If Forest Wolf is facing at a weird angle or at a weird postion, remember to set based upon to original and bake them under inspector. Do the setting according to your needs.
Hope this tutorial helps! Have a good day.
Leave a comment