|
Post by Macsum on Jun 26, 2022 11:03:37 GMT
Hi,
I have recently started giving master audio a try for my project.
I have an idle sound which I am triggering like this.
movingMaggotSound = MasterAudio.PlaySound("MovingOnFace_Maggot", 100, 1, 0f, "MovingOnFace_Maggot1");
The sound group MovingOnFace_Maggot is set to loop.
So when I have multiple maggots on the face, the audio is being looped for each of the maggots.
When one of these maggots get's disabled, I need to stop looping one of the MovingOnFace variations which it triggered.
How do I accomplish this? I only see ways to disable/stop/pause the entire sound group completely which mutes all maggots when I only want the one maggot to be muted.
Thank you for your time in advance.
|
|
|
Post by DarkTonic Dev on Jun 26, 2022 16:41:53 GMT
Since you used a PlaySound method that returns an object (not ones ending in AndForget), you can use that variable to stop the sound.
if (movingMaggotSound.ActingVariation != null) { movingMaggotSound.ActingVariation.Stop(); movingMaggotSound = null; // not going to use it anymore }
|
|