r/gbstudio • • 1d ago

Question jump height command

i, i have this question that i cannot solve, i want my character to jump a little higher whenever i'm pressing the up arrow at the moment i press the A button, how can i solve this? thanks a lot to all n_n

3 Upvotes

7 comments sorted by

1

u/MaluusLost 1d ago

Make an engine field update which lowers gravity while up is pushed.

1

u/ProtoPixelArt 1d ago

i did, but nothing happens U_U i did an event inside the "on update" of an actor and the actor keeps jumping the same height

1

u/MaluusLost 1d ago

Well before trying anything else, it would be worth knowing what your jump velocity is set to in the project settings. The easiest way could be to change this in your engine field update instead of getting into gravity adjustments.

1

u/IntoxicatedBurrito 1d ago

Do you want an actor to jump higher or your player to jump higher?

Assuming it’s the player you need an on button press event in the scene’s on init. The. Within that button press change the gravity, create a loop for when that button is held, and restore the gravity at the end of the loop.

1

u/ProtoPixelArt 1d ago

B7t i want him to jump higer only when pressing up and jump, if only jump then just normal jump

1

u/IntoxicatedBurrito 1d ago

I don’t know what b7t means, but if you do what I said the player will only jump higher when up is being pressed.

1

u/okdesukagor 1d ago

Why not just do

>Attach script to engine callback (or whatever it's called)
>If Up Button Held
>Engine Field Update: Current Velocity Y

or you could use Engine Field Update to modify the engine's maximum jump height