I'm currently activating a trigger parameter to cycle the jump animation using:
isGrounded
is my 'is player grounded bool', which I'm using to determine wether or not my player is allowed to jump. I'm using a child player object and using Physics2D.lineCast(myPlayer, myPlayerGround, playerMask)
to do so.
I'm triggering the jump animation (using a trigger parameter to transfer to the jump animation from the run or idle, which are the only 2 other animations I'm using which currently work flawlessly) using the spacebar, the same way I tap in to the y axis jump velocity.
I can't figure out a reliable way to reset the trigger. I tried resetting it if isGrounded
returned true, but then I'm assuming I'm getting a false positive, as it will only trigger in the first place if isGrounded
returns a true? I also tried triggering the animation on by running a check to see if isGrounded
returns a false, but if that's the case, the jump animation will play if I fall off a ledge, as well as actually jumping, which of course doesn't make sense.