How to get GLOBAL Parameter IDs (not GUIDs) in Unity

Hello,

Does anyone know how to get Global Parameter IDs in Unity (C# Scripts)? All of the info I’ve seen on this topic refers to instances where the parameters are local. Even then, a lot of the old forum posts about this topic use outdated code, and it’d be good to know what the current solution is. I’m currently using Unity 2021.1.12f1 and FMOD Studio 2.02.07. I suspect the FMODUnity plugin is also 2.02.07. I’ve tried an upgrade of it to the current edition, but it doesn’t change anything.

Thanks!

Hi,

You can get a parameter’s ID from its FMOD_STUDIO_PARAMETER_DESCRIPTION (FMOD Engine | Studio API Reference - FMOD_STUDIO_PARAMETER_DESCRIPTION.

To get the description you can use

FMODUnity.RuntimeManager.StudioSystem.getParameterDescriptionByName("ParamName", out FMOD.Studio.PARAMETER_DESCRIPTION desc);

Let me know if this is what you are looking for.

Hi, @Connor_FMOD. Thanks for the response. Wouldn’t this code take an Event as an argument? All I return in the console when using this code is:

FMOD.Studio.PARAMETER_ID
UnityEngine.Debug:Log (object)
MusicManagerNEW:Awake () (at Assets/Scripts/MusicManagerNEW.cs:42)

The lines of code being used are:

FMODUnity.RuntimeManager.StudioSystem.getParameterDescriptionByName("MusicType", out FMOD.Studio.PARAMETER_DESCRIPTION desc);
Debug.Log(desc.id);

I just need to see what that ID is. While we’re on the subject of id, will the ID of a parameter remain the same from the moment it was created in FMOD Studio, or are there circumstances that will cause a parameter ID to change?

EDIT: It seems I can return other information about the parameter, just not the ID!

Hi,

The ID is broken into two values data1 and data2 so I would suggest trying

Debug.Log(desc.id.data1 + desc.id.data2); 

Yes, the ID should remain the same from the creation of the event.

Correct, the parameter description includes a lot of useful information.