[SOLVED]Play Jump Sound Once When Jumping?

Hi,

Giving GDevelop a second try now…

Working on a very simple 2D game now to learn.

How can I play the jump sound once when jumping?
Is there a way to see if the player is sitting on a platform?

Currently using:
When [Space Bar] keyboard key is released, but it is not working well.

Let me know, thanks!

Jesse Lee

Can you include a screen snip of your code?

Look below:

Nevermind, got it working properly:

Hi Again…

Well, almost there:

If the player is falling off a ledge and the player presses [Space Bar],
the jump sound effect plays?

Any ideas?

Jesse Lee

Yes. When the player is on the floor, the value of PlayerIsNotJumping is set to true. But, it’s not set to false when the player falls, only once the space bar is pressed.


However, you’re over complicating things:

Instead of that variable, just have the Space key is pressed condition, along with Player is on the floor. If you also simulate the jump key pressed as the action, then that should be all you need (if you don’t simulate jump key pressed, then you’ll need to include a trigger once condition).

Makes sense, thanks!

I’ll probably have more questions as this little 1st game progresses…

there is a condition named “is jumping”, checking if the platformer object is jumping. Pairing that with the trigger once creates the jump sound perfectly, as in how a button press let’s the sound happen in any situation of the game.

Yes, that seems to work best, thanks!