Maybe the animation doesn't get recognised and, if it doesn't, it will prevent your whole event from firing sometimes. Try making it like this:
if (jump)
{
rb2d.AddForce(new Vector2(0f, jumpForce));
anim.SetTrigger("Jump");
jump = false;
}
and see if your character will jump and if the animation will play
↧