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

**URL:** <https://qa.fmod.com/t/when-two-parameter-has-same-name-how-to-use-getparameterbyname/21632>\
**Category:** FMOD Engine\
**Created:** [May 17, 2024, 7:18am UTC](https://qa.fmod.com/t/when-two-parameter-has-same-name-how-to-use-getparameterbyname/21632 "2024-05-17T07:18:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MisakaCirno](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MisakaCirno](https://qa.fmod.com/u/MisakaCirno)\
**Post date:** [May 17, 2024, 7:18am UTC](https://qa.fmod.com/t/when-two-parameter-has-same-name-how-to-use-getparameterbyname/21632/1 "2024-05-17T07:18:55Z")

</div>

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](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/8/8ae1448d992f87039cd34bc58c98253a80a54325.png)

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [May 21, 2024, 3:44am UTC](https://qa.fmod.com/t/when-two-parameter-has-same-name-how-to-use-getparameterbyname/21632/2 "2024-05-21T03:44:22Z")

</div>

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.

**![](https://lh7-us.googleusercontent.com/2H8F0ohaPZTZ2GGWwDEUt2CD6NnDM5AMGAgpt8lOofL0uD3_06tViZwTDRh6Alz2qnePT56VVK16fbkUlWRxqxVeZDpUyFn6PmqQZeGuHWRtBn2eg8PlmIbZDSuhHWQMh8LzWt-dH0r613IFbiw6KYk)**

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

Then you can call [`Studio::EventInstance::getParameterByName`](https://www.fmod.com/docs/2.03/api/studio-api-eventinstance.html#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.

---

<div class="post-metadata">

**Author:** ![MisakaCirno](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MisakaCirno](https://qa.fmod.com/u/MisakaCirno)\
**Post date:** [May 21, 2024, 4:04am UTC](https://qa.fmod.com/t/when-two-parameter-has-same-name-how-to-use-getparameterbyname/21632/3 "2024-05-21T04:04:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [May 21, 2024, 10:10pm UTC](https://qa.fmod.com/t/when-two-parameter-has-same-name-how-to-use-getparameterbyname/21632/4 "2024-05-21T22:10:58Z")

</div>

> [@MisakaCirno](#):
>
> `getParameterByName` can actually support both "just the name of the parameter” and “the full path of the parameter”?

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.
