# getParameterByName does not retrieve correct value when parameter is modified w/ command instruments

**URL:** <https://qa.fmod.com/t/getparameterbyname-does-not-retrieve-correct-value-when-parameter-is-modified-w-command-instruments/21759>\
**Category:** Unity\
**Created:** [June 13, 2024, 9:35am UTC](https://qa.fmod.com/t/getparameterbyname-does-not-retrieve-correct-value-when-parameter-is-modified-w-command-instruments/21759 "2024-06-13T09:35:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fxmldr](https://avatars.discourse-cdn.com/v4/letter/f/8e7dd6/32.png) [@fxmldr](https://qa.fmod.com/u/fxmldr)\
**Post date:** [June 13, 2024, 9:35am UTC](https://qa.fmod.com/t/getparameterbyname-does-not-retrieve-correct-value-when-parameter-is-modified-w-command-instruments/21759/1 "2024-06-13T09:35:14Z")

</div>

getParameterByName does not retrieve the correct value when the parameter has been modified through command instruments.

I have been experiencing this problem exclusively with the case of command instruments. As in, when modifying the parameter through C#, getParameterByName has been working as expected.

It is not that the command instruments are not working either, as I have checked.

---

<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:** [June 18, 2024, 5:00am UTC](https://qa.fmod.com/t/getparameterbyname-does-not-retrieve-correct-value-when-parameter-is-modified-w-command-instruments/21759/2 "2024-06-18T05:00:59Z")

</div>

Hi,

What FMOD Unity integration version are you using?

Just want to double check, are you using `eventInstance.getParameterByName("YourParameterName", out float value)` to retrieve the parameter value?

If that’s the case, would it be possible to try using `eventInstance.getParameterByName("YourParameterName", out float value, out float finalValue)` and retrieve the `finalValue`?

The first `value` is the explicit value you have assigned to the parameter using functions like `Studio::EventInstance::setParameterByName.`

The second `parameterValue` is the actual final value used during playback, considering all adjustments and modifications performed by FMOD’s internal processing and values passed in the public API. This will be the value assigned by the Command instrument.

For more information about this method’s parameter, please have a look at our docs here:  
[FMOD Engine | 6. Studio API Reference | Studio::EventInstance | Studio::EventInstance::getParameterByName](https://www.fmod.com/docs/2.03/api/studio-api-eventinstance.html#studio_eventinstance_getparameterbyname)
