Hi!
I’m having an issue when trying to stop an event triggered by a command instrument. I’m attaching the screenshot to show the event architecture. The goal is to have different events triggering the same music track to maintain nomenclatures and clarity for the unity implementation dev, while also keeping the simple stop functionality, so that the dev just stops the event and this propagates to the original track triggered in the beginning. But somehow, the stop is not working and the track keeps playing. This works if I test it inside FMOD but inside the game its not working. Maybe I’m missing something?
Thanks!
This is occurring because you’re using a command instrument instead of an event instrument.
When a command instrument is triggered, it spawns an instance of the event it targets, which is routed into the mixer and exists independently of the event instance that spawned it, and will continue to exist independently even if that parent event instance is stopped. The only way to stop an event instance started by a command instrument is to use a “stop event” command instrument. (In FMOD Studio, stopping the parent event will also stop event instances spawned from command instruments in that event, but this is purely to make auditioning events with command instruments more convenient and does not reflect in-game behavior.)
In your case, you should use event reference instruments (more commonly known as “event instruments”) instead of command instruments. Unlike event instances spawned from command instruments, the event instances spawned from event reference instruments are routed into the parent event instance and does not exist independently of that parent event instance, meaning that it will stop when the parent event stops.
To create an event instrument for an existing event in your project, drag that event from the events browser onto a track of a different event in the event editor window.