So i got this way of checking to see if the player is running or not, now i wanna create a way to check if the player is actually climbing or just hanging onto the ladder,
if (isGrounded) // ground check
{
// Nếu trị tuyệt đối của vận tốc > Epsi thì chạy animation running
if (Mathf.Abs(myRigidbody2D.velocity.x) >= Mathf.Epsilon)
{
myAnimator.SetBool("isRunning", true);
}
else // còn nếu không(đứng im) thì cho đứng im = cách tắt animation running đi
{
myAnimator.SetBool("isRunning", false);
}
}
So ive been wondering, can i use myRigidbody2D.velocity.y != 0 to check the player velocity instead of abs and epsilon and all to simplify my code?