How to access a parameter by Guid?

Hello,

I’ve been using the Guids generated from Studio to have a layer of indirection over the Studio project structure.

I can access events just fine:

FMODUnity.RuntimeManager.PlayOneShot(someSfxGuid);

I can also access VCAs just fine, though GetVCA only accepts a Guid string, formatted with the braces, and not an actual Guid struct:

FMODUnity.RuntimeManager.GetVCA(someVcaGuid.ToString("B"));

However, this doesn’t work:

FMODUnity.RuntimeManager.StudioSystem.setParameterByName(myParameterGuid.ToString("B"), 1);

There is a setParameterByID function which accepts a PARAMETER_ID struct, but that seems to be a different thing entirely (half the memory size of a Guid), which I’m not even sure where/how to look up.

By the way, setParameterByName("SomeName") does seem to work when I look up and print out the value from code, but it doesn’t change in the Studio over Live Update.

Also there doesn’t seem to be any generated logging for any of this.

1 Like

Are you checking the returned result of the FMOD functions?
If one of the calls isn’t being executed this will help.

Parameter ID is a replacement for indicies (ie. EventInstance::getParameterValueByIndex) and requires less recourses than guids to use at runtime.
https://fmod.com/resources/documentation-api?version=2.1&page=welcome-whats-new-200.html#new-parameter-api

The problem is there’s no way to get PARAMETER_ID using GUID. There’s only getParameterDescriptionByName and getParameterDescriptionByID. Even when using getParameterDescriptionList, descriptions have no GUIDs so there’s no way to get Parameter using GUID.

It looks like this was answered in another thread.