# Find parameter index for using setParameterValueByIndex(int index, float value)

**URL:** <https://qa.fmod.com/t/find-parameter-index-for-using-setparametervaluebyindex-int-index-float-value/12324>\
**Category:** Unity\
**Created:** [February 21, 2016, 5:37pm UTC](https://qa.fmod.com/t/find-parameter-index-for-using-setparametervaluebyindex-int-index-float-value/12324 "2016-02-21T17:37:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliran](https://avatars.discourse-cdn.com/v4/letter/o/a8b319/32.png) [@oliran](https://qa.fmod.com/u/oliran)\
**Post date:** [February 21, 2016, 5:37pm UTC](https://qa.fmod.com/t/find-parameter-index-for-using-setparametervaluebyindex-int-index-float-value/12324/1 "2016-02-21T17:37:17Z")

</div>

Hi,

I am using Unity and would like to access fmod parameters by index instead of strings (for improved performance). I know there is a function setParameterValueByIndex, but I can’t figure out how to get the index of a parameter.

Thanks!

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [February 21, 2016, 11:24pm UTC](https://qa.fmod.com/t/find-parameter-index-for-using-setparametervaluebyindex-int-index-float-value/12324/2 "2016-02-21T23:24:40Z")

</div>

Use [Studio::EventDescription::getParameterCount](http://www.fmod.org/documentation/#content/generated/FMOD_Studio_EventDescription_GetParameterCount.html) and [Studio::EventDescription::getParameterByIndex](http://www.fmod.org/documentation/#content/generated/FMOD_Studio_EventDescription_GetParameterByIndex.html).

---

<div class="post-metadata">

**Author:** ![oliran](https://avatars.discourse-cdn.com/v4/letter/o/a8b319/32.png) [@oliran](https://qa.fmod.com/u/oliran)\
**Post date:** [February 21, 2016, 11:29pm UTC](https://qa.fmod.com/t/find-parameter-index-for-using-setparametervaluebyindex-int-index-float-value/12324/3 "2016-02-21T23:29:11Z")

</div>

> [@](#):
>
> Use [Studio::EventDescription::getParameterCount](http://www.fmod.org/documentation/#content/generated/FMOD_Studio_EventDescription_GetParameterCount.html) and [Studio::EventDescription::getParameterByIndex](http://www.fmod.org/documentation/#content/generated/FMOD_Studio_EventDescription_GetParameterByIndex.html).

So would index 1 be the first parameter, 2 the 2nd, etc?

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [February 21, 2016, 11:30pm UTC](https://qa.fmod.com/t/find-parameter-index-for-using-setparametervaluebyindex-int-index-float-value/12324/4 "2016-02-21T23:30:31Z")

</div>

No, use getParameterByIndex() to look at the name to find the parameter you’re looking for.

---

<div class="post-metadata">

**Author:** ![oliran](https://avatars.discourse-cdn.com/v4/letter/o/a8b319/32.png) [@oliran](https://qa.fmod.com/u/oliran)\
**Post date:** [February 21, 2016, 11:42pm UTC](https://qa.fmod.com/t/find-parameter-index-for-using-setparametervaluebyindex-int-index-float-value/12324/5 "2016-02-21T23:42:52Z")

</div>

Ah, thank you! I got it working using this information. I used getParamaterByIndex and then used getDescription.name to match name to id. Then stored id in list so I can reference it whenever I need it.
