My Animated Character Moves Away from the Camera

I got the character from the asset store and it is using Mecanim. The problem is when I execute the kicking and punching animations, it moves away from the camera. The camera and the 3d model are both parented to the player controller.

I’ve added some constraints to it but it still moves away. If I parented the camera to the model, it solves the issue bur the camera follows its movements and its shaky and nauseating in VR mode.

Video of the problem

To me it looks like the character is not returning to the same location after the kick. He is instead in a different X → right location.

Is the player controller represented by an empty game object in the scene?
Is the character also moving away from the player controller object in the scene when he performs the kick?
If the player controller is not represented by a empty game object in the scene you can test to see if the character is actually moving away from the player controller position by placing a empty go at the coordinates the player controller is located, parent it to the player controller, then see if the character moves away from the empty game object while he kicks.
If this is happening - I think the animation would need to be edited to return the character back to the original location he occupies before the kick, or turn off X root movement, but you probably don’t want to do that.
You might also be able to adjust velocity of the animation itself to remove the undesired X → right movement in that specific animation but that is commonly only fixed in root rotation or Y transformation.

I’ve got some idea from your suggestion. I just made my own 3rd person controller and added a kinematic rigid body into the animated character with position sanctions. It solved the issue.

The controller is parented to the animated character itself.

1 Like