How do I stop only objects sound?

Get help using Construct 2

Post » Thu Apr 27, 2017 4:06 pm

There is a button that spawns an object, once the object is spawned it plays a looping sound "Rain".
Once i double click the object, it gets destroyed and stops "Rain" sound with it.
But there are multiple of same objects on the screen and i don't want all "Rain" sounds to be stopped.
How do i fix this?

RainCloud - On Created - Play sound Rain
RainCloud - On Destroyed - Stop Rain sound
B
6
Posts: 4
Reputation: 318

Post » Thu Apr 27, 2017 4:07 pm

have a variable for each one maybe or an array or instance variable
Image
B
24
S
13
G
11
Posts: 279
Reputation: 8,689

Post » Thu Apr 27, 2017 4:32 pm

@EDplus

When you play a sound, there is an option for a Tag, set that to the RainCloud's UID which is unique to that object, then stop the sound using that Tag.

RainCloud - On Created - Play sound Rain, Tag = RainCloud.UID
RainCloud - On Destroyed - Stop sound, Tag = RainCloud.UID
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
33
S
9
G
7
Posts: 450
Reputation: 6,780

Post » Thu Apr 27, 2017 4:48 pm

Fixed this by doing:
RainCloud - On Created - Play sound Rain, Tag = RainCloud.UID&"Rain"
RainCloud - On Destroyed - Stop sound, Tag = RainCloud.UID&"Rain"
B
6
Posts: 4
Reputation: 318


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 61 guests