[Solved] How do I make a sound play only once?

Get help using Construct 2

Post » Thu Oct 20, 2011 6:47 pm

I want a jump sound to play when the player sprite jumps, but when I tried to set that up the sound ended up playing on loop the entire time it was in the air.

While I have gotten it to Sort of work (the sound doesn't play when jumping multiple times with little time in between), there must be a better way.
Here's what I have right now.


Thanks for any help. bologna2011-10-20 20:09:46
B
2
G
2
Posts: 5
Reputation: 1,085

Post » Thu Oct 20, 2011 7:13 pm

Add a 'trigger once' condition. The event sheet is read once every tick (~60 times a second) so if you use a condition like 'is jumping', it is checked and true constantly, 60 times a second. If you put a play sound action in an event like that, it will play 60 sounds a second, which will sound pretty awful.

Adding a 'trigger once' condition beneath it turns it in to a trigger.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Thu Oct 20, 2011 8:11 pm

Ah, thank you Ashley! Works perfectly.
Cheers
B
2
G
2
Posts: 5
Reputation: 1,085


Return to How do I....?

Who is online

Users browsing this forum: Pandadoor, Yahoo [Bot], Zebbi and 20 guests