When two parameter has same name, how to use getParameterByName?

According to the documentation, getParameterByName requires the name of the parameter to be used.
I noticed that in FMOD it is not possible to create parameters with the same name, but it is possible to have parameters with the same name in different folders.
For this situation, how should I get a parameter with a specific name?

QQ截图20240517151715

Hi,

In FMOD, when dealing with parameters that may have the same name but are organized in different folders or banks, we would recommend to specify the full path to the parameter to ensure that you’re accessing the correct one.

Here is how you can do that:
Right click a parameter => Copy Path

Then you can call Studio::EventInstance::getParameterByName and pass in the full path to get a parameter with a specific name.

Hope it helps, let me know if you have any questions.

1 Like

That is, getParameterByName can actually support both “just the name of the parameter” and “the full path of the parameter”?

In that case, the documentation may not be accurate enough, so perhaps you could add a description.

Yes, getParameterByName can indeed support both the name and the full path of the parameter.

I can clearly see why you get confused by the documentation, maybe changing the function name to getParameterByNameOrPath would help to clarify its usage. We will definitely consider this as we look into ways to improve our API and documentation for better readability and clarity.

Thanks for your advice! If you have any further questions or recommendations, please let me know.

1 Like