How do I

Get help using Construct 2

Post » Sun Nov 06, 2016 11:14 am

How do I get a sound to only play once when a key is pressed - I thought that this would work?

http://planetserve.com/sound.capx
B
17
S
6
G
1
Posts: 83
Reputation: 1,895

Post » Sun Nov 06, 2016 11:39 am

The triggered once is unnecessary, because the 'one pressed' event is a triggered event (green arrow).
It will trigger every time you press z but only once, even if the sound is playing. If you want that it only plays when the sound has ended you have to use a second condition.
An example:
Give your sound a tag-name, something like FlipperSound.
Code: Select all
Keyboard| On Z Pressed                 -> Audio| Play flipper not looping ... (Tag"FlipperSound")
Audio|(invert) Tag "FlipperSound" is playing
B
24
S
3
G
1
Posts: 454
Reputation: 2,171

Post » Sun Nov 06, 2016 2:11 pm

Thanks Asmodean!
B
17
S
6
G
1
Posts: 83
Reputation: 1,895


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests