Hi! So in the lesson listed above Rick was making a “TileVania”, and he stated, ‘I’m fine with jump using Running animation’. I tried to implement Jumping animation based on what I’ve learned in previous lessons and only got this far:
void OnJump(InputValue value)
{
if (!playerCollider.IsTouchingLayers(LayerMask.GetMask("Ground"))) { return; }
if (value.isPressed)
{
playerRb2d.velocity += new Vector2(0f, jumpForce);
playerAnimator.SetBool("isJumping", true);
}
}
Also I made sure Jump animation isn’t looping and has Exit Time enabled (put it on 1).
Now, the problem is after making a jump and playing the correct animation it freezes on the last frame, and after that my character is idling, running and jumping on that single frame.
I know it is because I never set the bool isJumping back to false. But I tried some ideas and never really figured out how to do it properly without creating another bool isGrounded, which would make another check and only then reset the state to Idle.
Maybe someone can help me figure out this one?
P.S. Excuse me for my mistakes, if there are any