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:
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
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
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.