character not updating position after an animation

Hello,

I am making a soccer like game.

I am using the same Third person character scripts that come with the Sample Assets package that comes with Unity 5.

I added a tackle animation for the player in the Animator Controller.

I added also an integer parameter called Tackle.
When Tackle becomes 1, then the Tackle animation will start.
Here is a short code I added to Update method in ThirdPersonUserControl.cs script.

if (Input.GetKeyDown (KeyCode.X))
                anim.SetInteger ("Tackle", 1);
            else
                anim.SetInteger ("Tackle", 0);

The problem is that when the player finishes the Tackle animation, it goes backward.

Here is a short video:

As you can see in the video, the pivot is not following the character.

I want the character to stay in the position where the tackle animation has finished.

Here is a screenshot of the Animator Controller:

and here are the settings of the transition from Tackle to Grounded:

How can I solve this ?

In my animations, I keep everything center. Then if movement is needed, I use a piece of script called MoveForwardForSeconds, which is a coroutine that will move the character forward with a certain speed for a certain amount of time… It works for me :slight_smile:

Alternatively, I think you can create an empty gameobject, then add your current character to this empty gameobject. Then, use this empty gameobject for all movement (including the one in this animation). I’m 99% sure this solution would also work, but not 100% - sorry :slight_smile:

Thanks for the reply. I actually solved the problem:smile:.

I accidentally checked Bake Into Pose under Root Transform Position (XZ) in the Animation Import Settings .

When I unchecked that, the problem was solved.:wink:

I have now another problem, which is that when the player tackles either to his right side or to his left side, the animation plays in place (the player is not moving). While If the player tackles either forward or backward, the animation works perfectly.

How can I solve this?:frowning:

Anyone ? :(:frowning: