Double Jumping

Is it possible to make the player double jump with the default jumping engine? Currently, if I press the jump key while in the air, the player doesn’t jump again. I think the problem is that when jumping, the engine checks if the player is onGround before jumping.

You could just set a flag, that the player is allowed to jump after he jumped.

If this flag is true and the player presses the jump key again you apply a force in direction of the Up-Vector so your player is “jumping” again. After setting the flag to false again he cant jump again. You have a double jump.

Hmm… don’t know what flags are… Will look them up.

Just a boolean indicating a state, permission or something like that.

But I can’t use player.jump() :confused: Will have to create the jump engine myself.

Mh. You are right indeed.

I thought the CharacterControl had a applyForce method so you could easily do a second jump. I looked it up and found out thats wrong. My apologies.

Sorry, but in that case… I dont have a clue. :smiley:

The character is a very basic pre made class in bullet. It uses a GhostObject and a kinematic RigidBody as well as ray tests to simulate a character. If you implement this yourself (maybe even using the KinematicRagDoll for added character detail) you have more control over how it works.

@KuroSei, don’t worry, we’re both humans, we make mistakes :wink: Thanks all the same.

@normen, yeah, I am making one myself, and it does give me more control.