Double Jump Example: Learn how to make one

I recreated this (I didn’t know how to copy and paste) and when I double jump
He just stops gaining height

1 Like

You can copy and paste into your game by copy and importing. You copy the bundle in the example and you import the code in your game.

Once you do, you should still go into the code and adjust the raycast behavior to be a little bit below your character. Do this for both the “Run” bundle and the “Jump & Double Jump” bundle.

image

4 Likes

Thanks @JR01, spot-on :blush: @KingUltima its easier to import and adjust the values as intended.
Let us know how it goes!

2 Likes

Pixel Pizza,

You saved the day again! I was confused about double jumping (For my Flowjam game). Thank you for making this tutorial.

Thanks again,
Ember.Y

1 Like

Oh, @Samuel_Tomé_PixelPizza,

I transferred the bundle to my game and now the player can double jump infinitely.


Here is an image of the code.

1 Like

That is some funky spacing…
Also, how long is the Ray Cast?

This could be because of various things…

Check out the ray cast value (might be too long), the timers (might be too short), and the collision shape of the player (I recommend capsule to stay away from collision bugs).

1 Like

Yes, I am using Capsule.

How long should it be for a two by one player object?.

1 Like

Each Flowlab block or grid space is 32 pixels long by 32 pixels wide. For your one-block-wide-two-blocks-tall character, you need it to be 64 pixels long and 32 pixels wide.

2 Likes

image
The ray cast is from the middle. I use 40 ray casts. (Length.):
image

1 Like

40 should work then. If it comes from the top, change it to 64 or a bit higher like 65 or 70.

1 Like

I can still activate the impulse infinitely.

1 Like

I’m not sure then. I’d have to look at all the code of the player.

Hi @JUSTPLAINOP wanna send me the link (PM here or in discord)? I can look into it to know whats wrong

Is the Raycast set to the ground object? If its set to any its probably hitting an attached object making you able to jump infinitely. @JUSTPLAINOP

3 Likes

From the first (original) post here.
Thanks @John_Shrekinson @DinoDev @CodeAlpaca
for helping him too <3

3 Likes

XD!
image
image
Thank you so much for your help, all of you! It is much appreciated! Also,

Never mind, I fixed it

I do not use discord, but yes, I can PM you the link. I still need help putting the other ray cast(s) together inside of your bundle.

Thanks for your help!
-Ember.Y

1 Like

Awesome, glad to help :blush:

1 Like

camera broke when I used this, idk why, but the camera doesn’t;t move on the Y axis

Hey, @EmberJack18. Welcome to the Community.

If this isn’t a problem related to the Double Jump bundle itself, then it’d probably be better to make a separate topic for it.

I can help, but I don’t want to go off-topic on this example topic.

Thanks,
-Ember.Y

1 Like

it’s probably not related to this example’s logic.
But I will assume a bit and try to give you some general solutions, make sure you only have one camera behavior in the level, and ensure that the camera boundaries are correct :blush:

1 Like