Problem with sounds!

Get help using Construct 2

Post » Fri Oct 06, 2017 2:39 pm

Hi there!

I have a jump-sound playing whenever the player jumps, which is constantly. The problem is that when the player jump several times within a second, it sounds terrible. So, I was wondering if it's possible to not play the jump-sound if the jump-sound has just been played?

For example: Don't play jump-sound if it was played 0,1 seconds ago.

Or: Don't play jump-sound if the jump-sound is already playing.

Thanks in advance,
Tomolo Games
B
22
S
7
G
3
Posts: 107
Reputation: 3,292

Post » Fri Oct 06, 2017 2:48 pm

Should you be able to jump several times within a second?
B
53
S
21
G
95
Posts: 2,453
Reputation: 56,121

Post » Fri Oct 06, 2017 2:58 pm

I recorded a video so you can see/hear the problem. Problem 8 seconds in the video

https://www.youtube.com/watch?v=Ioq7AbLloL4&feature=youtu.be
B
22
S
7
G
3
Posts: 107
Reputation: 3,292

Post » Fri Oct 06, 2017 3:01 pm

The player automatically jumps as soon at it hits the "floor" and if there, for example, is something above the player and the "floor" the player is bouncing up and down very quickly and that's when the sound problem starts. Do you understand what I mean? I'm not the best at explaining things and my English sucks :p
B
22
S
7
G
3
Posts: 107
Reputation: 3,292

Post » Fri Oct 06, 2017 3:04 pm

Yeah it's a weird one because it shouldn't really be possible to 'jump' that fast, but at the same time if you lock the sound out which is easy to do you're going to have the player jumping with no sound playing. You could try playing the jump sound with a trigger once condition on hitting the floor, (on landed?)
B
53
S
21
G
95
Posts: 2,453
Reputation: 56,121

Post » Fri Oct 06, 2017 3:04 pm

Every time you play a sound you can assign a tag to it. So play your jumping sound with tag="jump".
Before playing check if "jump" sound is already playing and either stop it or don't play new sound.
Something like this:

Code: Select all
    Audio -> Is tag "jump" NOT playing
           Audio -> Play "your jumping sound" (tag "jump")
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
19
S
9
G
158
Posts: 2,401
Reputation: 84,429

Post » Fri Oct 06, 2017 3:25 pm

Audio -> Is tag "jump" NOT playing
Audio -> Play "your jumping sound" (tag "jump")


I'm not sure if I understand what you mean because this just makes it play the jump-sound repeatedly?
B
22
S
7
G
3
Posts: 107
Reputation: 3,292

Post » Fri Oct 06, 2017 3:37 pm

I meant replace your existing action (Audio->Play jumping sound) with those 2 lines.
This is what you wanted, isn't it?
Don't play jump-sound if the jump-sound is already playing.


I didn't see your code and don't know where you play your sound. I'm guessing it's inside some event, maybe On collision with a floor, or On key "Up" pressed. So insert my 2 lines inside that event.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
19
S
9
G
158
Posts: 2,401
Reputation: 84,429

Post » Fri Oct 06, 2017 3:42 pm

But then it plays the jump-sound when the player is not jumping instead of playing the jump-sound when the player is jumping?
B
22
S
7
G
3
Posts: 107
Reputation: 3,292

Post » Fri Oct 06, 2017 3:48 pm

No, it doesn't check if the player is jumping or not, it checks if the sound is playing.
Again, I don't know how and when you check if the jump is made and decide to play the sound.

Could you share the screenshot of your entire event where you play you jumping sound?
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
19
S
9
G
158
Posts: 2,401
Reputation: 84,429

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests