How do I...use 'choose' to play a random sound.

Get help using Construct 2

Post » Mon Sep 29, 2014 10:15 pm

Hello all,

Im trying to play a random sound from a collection of three sounds. I have the sound labels/files:

sound1
sound2
sound3

Then on a button click I have:

choose("sound1", "sound2", "sound3")

The problem is that the sound1 seems to play first time and everytime and also seems to play while the other sounds are playing. I think I have to 'stop' sound1 (or whatever sound is randomly picked) before sound2 or sound3 is played on the next click?

Do I have this right? If so, why is this not 'random' and why do two files play at the same time?

Thanks so much.
B
15
S
2
Posts: 229
Reputation: 1,353

Post » Mon Sep 29, 2014 10:16 pm

Could you make a screenshot of your events?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Sep 29, 2014 10:20 pm

Thanks :)

Capture.PNG
You do not have the required permissions to view the files attached to this post.
B
15
S
2
Posts: 229
Reputation: 1,353

Post » Mon Sep 29, 2014 10:21 pm

Oh what a fool I am - I see from the screenshot that I left in an old 'Play' - just took it out and it works great. :)

Thanks anyways :)
B
15
S
2
Posts: 229
Reputation: 1,353

Post » Mon Sep 29, 2014 10:23 pm

if you remove the play sound 1 action you should be ok..

for now you are saying to always play sound one on button pressed and play the choose sound..

Haha.. saw you already figured it out..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest