This page explains how Unity root motion animation works:To understand the problem, read ahead or skip to 'how to fix' in end the for solutions:Body root transform/node can be thought as 'reference point' of skeleton relative to 3d space where it and it's animation exists. In Unity humanoid rigs, it is the only world space node for skeleton according to Unity manual (see link above).In animation software animations are usually done either 'in-place' or by moving characters in scene space.
It might be easier to animate a run loop 'threadmill' style, so that legs and arms swing yet hips stay on place (character does not translate in 3d scene space). On the other hand, it might be easier to animate a jump and roll over fence so that character moves in 3d scene space, this way feet and hands can be firmly planted on key moments.According to Unity manual, Unity's implementation of root motion concept works like this: Root motion is calculated from body transform node in run-time.
In animation clip, body transform might move relative to animation scene 'world space', but what Unity does, it computes this offset every frame, and then applies it to game object as movement instead, and what they don't say - removes it from root node. By toggling 'Root Transform Position (XZ), Bake into pose on, you'll see that this process is reversed, and you'll see your character sprint away from animation clip origin, if your animation clip skeleton is animated moving in scene space, that is. When you toggle bake into pose off, you see that world grid starts to travel under character, meaning that Unity has removed the root x and y movement (transform/GameObject is moving).(Reasons for this are understandable but Unity explanation for this is not very clear. For example, Unreal engine explains it's own implementation quite clearly: )Mixamo animations might be animated / captured this way moving in 3d space, and will have skeleton root moving away from origin. But if this root node movement exists, it results in unity root motion values, which in turn will be moving GameObject in scene.
If there is movement in animation clip character's hips (whatever the topmost joint is), Unity will see it as offset, and will move your character Transform/GameObject in scene. There are no check boxes to remove x and z animation from character root node IIRC.How to fix:a.
Recreate animation export in Mixamo if possible, so that character is animated in-place (mentioned already in comments).b. Remove root offset movement in Unity. Make a copy of animation clip (so that you can change it), open it in Animation Window then find the skeleton root node, select and delete keyframes for translation animation from both x- and z-axis, and leave y-axis movement untouched.c. Take animation back into animation software (Maya) or motion editing/authoring software (Motion Builder) and modify the animation clip to remove the root animation. In the inspector for the animation file (e.g walking.fbx), in the Animation pane, if you check both 'Loop time' and 'Loop Pose' then the animation will be in place.Another technique is in the animation window, the base animation will be read-only, but if you copy all the properties into a new animation and remove the Hip motion you should be in place.Also, and maybe this is more adapted to your particular issue. If you set the rig type to humanoid, then you will be able to 'Bake into pose' XZ, Y and rotation.
Which will deactivate root motion for the particular parameter.
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience. This website uses cookies to improve your experience while you navigate through the website.
Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.