I have an event that is triggered like so:
instance = RuntimeManager.CreateInstance(eventReference);
instance.play()
The event also triggers additional event that is looped. The problem is that I can’t stop the looped event no matter how I try! I’ve tried:
1 - stopping the original event that I have a reference to - does not stop the looped one
2 - playing via StudioEventEmitter and calling .Stop() - does not stop the looped one
3 - mcg.setMode(MODE.LOOP_OFF) - no effect at all
4 -
RuntimeManager.CoreSystem.getMasterChannelGroup(out var mcg);
mcg.stop();
mcg.clearHandle();
mcg.release();
- Stops the current loop, but after the current loop cycle ends it starts playing again
Hi,
Thank you for sharing the information.
Could you please share a screenshot showing how you have set up the event? Specifically, how the looping event is triggered?
If you’re using a standard nested event, stopping the parent event should also stop any nested events.
However, if the looping event is triggered by a command instrument, stopping the parent event will not stop the triggered event. In that case, you’ll need to manage the triggered event instance separately.
One option is to create a separate event that includes a command instrument specifically set to stop the looping event. You can then play this stop event when you need to stop the looping audio. Please note that it stops all active instances of the specified event. This means that if multiple instances of that event are playing, all of them will be stopped simultaneously.
Hey, thanks for the reply.
I don’t have access to the original FMOD project, I have just the banks
Its a part of a fan content kit for a popular game so I don’t have a way for showing how it’s set up.. When I stop the parent the looped one continues playing so it knocks out th first case. Is there any way I can get around this without an access to the project?
Unfortunately, without access to the original FMOD project or the ability to modify it, your options are quite limited. The FMOD API doesn’t provide a direct method to stop specific instances of events triggered by command instruments, especially when you don’t have references to those instances.
One possible workaround is to mute or reduce the volume of the bus the looped event is routed through, or even the master bus if necessary. While this won’t stop the event itself, it will silence its output. Please note that this approach may also affect other sounds that share the same bus, so use it with caution.
Alternatively, you could use Studio.Bus.stopAllEvents to stop all event instances routing through a particular bus. Keep in mind this stops the events but does not release their instances, so they may still occupy memory.
That worked! Tank you very much
1 Like