Sliding Animation doesn't Work Properly

Hello,

I’m working on 3D project. I added the sliding animation, set it to “Trigger” in the Parameter and connected it to the running animation. Now the player slides but as he gets up he moves back at the point when the sliding animation begins to perform. How could I make him to get up at the present point?

I’ve been working on this, doing this and that from the items that I found on various videos but I couldn’t worked it out. I even put the slide perform code in the player’s movement region.

        Vector3 velocity = movtDir * inputMagnitude;
        velocity.y = ySpeed;
        characterController.Move(velocity * Time.deltaTime);

        if (movtDir != Vector3.zero)
        {
            animator.SetBool("IsMoving", true);

            Quaternion toRotation = Quaternion.LookRotation(movtDir, Vector3.up);

            transform.rotation = Quaternion.RotateTowards(transform.rotation, toRotation, rotationSpeed * Time.deltaTime);

            if (Input.GetKey(KeyCode.R) && isSliding == false)
            {
                isSliding = true;

                Sliding();
            }
        }
        else
        {
            animator.SetBool("IsMoving", false);
        }
   

private void Sliding()
{
        animator.SetTrigger("Tackle");
}  

I think Root Motion is what you have to dig into:

1 Like

Thanks a million!

1 Like