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
have a variable for each one maybe or an array or instance variable
Develop games in your browser. Powerful, performant & highly capable.
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
Fixed this by doing:
RainCloud - On Created - Play sound Rain, Tag = RainCloud.UID&"Rain"
RainCloud - On Destroyed - Stop sound, Tag = RainCloud.UID&"Rain"