Reset JumpCurrentCount after stomping enemy?

I came up with a basic fix that works pretty well:

  1. I set my NPC’s capsule collision to CanCharacterStepUpOn = (Owner)
  2. After detecting that my Player has collided with an NPC near the player’s feet, I kill the NPC and call Jump() on my player

The result is that if I land on an enemy, it’ll count as “ground” for a frame, clearing my jump count, and the Jump() call will cause my player to bounce up. Then I can press jump again to double jump in the air, etc.

There are (literal) edge cases with this approach, if my method of detecting that the player landed on the enemy declares positive but the physics engine doesn’t let the player step on the enemy because the angle is slightly off, but I think that can be cleared up by either:

a.) Making sure the collision event has the same parameters as the character’s step angle
b.) (haven’t tried this yet) Doing a “Are you standing on this” check against the NPC before declaring a successful stomp

1 Like