[Unity] Stuck in migration, need to retrieve an event from emitter.

(Mauricio Dal Fabbro) #1

Hi, i’m migrating the old version of Fmod Unity for the new one, i have a quick question, in the old version, i was able to retrieve an event from an emitter, something like this:

FMOD_StudioEventEmitter emitter = GameObject.FindWithTag("GameController").GetComponent<FMOD_StudioEventEmitter>();
controllerEvent= emitter.Event();

But now, with the new version, i can’t do that anymore, i’ve tried with something like this:

FMODUnity.StudioEventEmitter emitter = GameObject.FindWithTag("GameController").GetComponent<FMODUnity.StudioEventEmitter>();
FMOD.Studio.EventInstance controllerEvent = FMODUnity.RuntimeManager.CreateInstance(emitter.Event);

But i know that i’m just creating another instance (duplicate) and i want to change/play/stop the original event instance, what i’m missing?

would be great if someone can point me in the right direction,

Thanks in advance!

(Cameron Baron) #2

The event in StudioEventEmitter isn’t accessible, only the string/event name.
You could always manage an event instance yourself with very little effort, see basic script example.