Get parameter ID from EventEmitter

I’m trying to get the parameter ID from a StudioEventEmitter, but there seem to have been some changes to the API, as I’m getting the following error:

“StudioEventEmitter.Event” is obsolete: Use the EventReference field instead"

This is my code:

public FMODUnity.StudioEventEmitter Emitter;
FMOD.Studio.EventDescription OcclusionDescription;
FMOD.Studio.PARAMETER_DESCRIPTION VolumeDescription;

void Awake()
    {
        OcclusionDescription = FMODUnity.RuntimeManager.GetEventDescription(Emitter.Event);
        OcclusionDescription.getParameterDescriptionByName("Volume", out VolumeDescription);
        VolumeId = VolumeDescription.id;
    }

How do I change it, to make it work with the new API?

Hi,

All you need to change is the line

OcclusionDescription = FMODUnity.RuntimeManager.GetEventDescription(Emitter.Event);

To

OcclusionDescription = FMODUnity.RuntimeManager.GetEventDescription(Emitter.EventReference); 

Hope this helps!

1 Like

Thank you very much, works like a charm.

1 Like