Jump Animations

Is there a way that I can have some help with figuring out the jump animation. It’s a little bit more complicated than I hoped.

Hey there! I realize this is months later, but are you still working on the jump animation? If so, check out using a Trigger rather than a Bool so it only fires off once. Here’s what I came up with. It’s not perfect, but it works!

    void OnJump(InputValue value)
    {
        if (!IsTouchingGround()) { return; }

        if(value.isPressed)
        {
            rb.velocity += new Vector2(0f, jumpForce);
            JumpAnimation();
        }
    }

void JumpAnimation()
    {
        animator.SetTrigger("pressedJump");
    }

Privacy & Terms