Randomly select sound (works)

Get help using Construct 2

Post » Fri Jul 06, 2012 8:02 pm

How do I randomly select a sound. For example I want my bullet's when they impact a certain enemy to select from two separate bullet impact to metal sounds. To create a more authentic sfx overall. Erndog2k2012-07-06 20:39:14
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Fri Jul 06, 2012 8:37 pm

I figured it out and it works very well


Random Metal sounds by N7Effect, on Flickr


Just set two "Global" Variables. For the sound selection.

I also have Global Variables set for SoundVol, MusicVol.

Randomly select from two Variables ThreadErndog2k2012-07-06 20:43:24
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Fri Jul 06, 2012 9:38 pm

You could also use 'Play by name' and enter:
choose("sound1", "sound2", "sound3")
or however many sounds you have. Saves some events.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Fri Jul 06, 2012 9:55 pm

[QUOTE=Ashley] You could also use 'Play by name' and enter:
choose("sound1", "sound2", "sound3")
or however many sounds you have. Saves some events.[/QUOTE]
This method works really well and is cleaner;]
B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Fri Jul 06, 2012 10:31 pm

[QUOTE=Ashley] You could also use 'Play by name' and enter:
choose("sound1", "sound2", "sound3")
or however many sounds you have. Saves some events.[/QUOTE]

@Ashley
Well that saves time. Leave it to me to find the hardest way possible. Thanks :)
B
27
S
11
G
1
Posts: 246
Reputation: 5,048


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests