# FMOD Studio fails to set the correct local parameter?

**URL:** <https://qa.fmod.com/t/fmod-studio-fails-to-set-the-correct-local-parameter/16212>\
**Category:** Unity\
**Tags:** unity, csharp\
**Created:** [September 22, 2020, 11:50pm UTC](https://qa.fmod.com/t/fmod-studio-fails-to-set-the-correct-local-parameter/16212 "2020-09-22T23:50:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![laurganta](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@laurganta](https://qa.fmod.com/u/laurganta)\
**Post date:** [September 22, 2020, 11:50pm UTC](https://qa.fmod.com/t/fmod-studio-fails-to-set-the-correct-local-parameter/16212/1 "2020-09-22T23:50:41Z")

</div>

Hei, I’m trying to setup a simple door open/close event which has a local parameter called state which selects which of the 2 sounds it should play.

 ![fmodquestion](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/5/5a2090799a28997974552af338c08c15ebf60034.png)

I think I am doing everything right in Unity as well.

Walking through the door will always play the off (close) sound, even when parameter is set to 1 (on).

I used the FMOD Profiler to figure out if the parameter is being set, but it says it’s always off.

I use the exact same approach to setup footsteps and everything works fine there.

Am I doing anything wrong here?

Thank you!

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [September 30, 2020, 3:30am UTC](https://qa.fmod.com/t/fmod-studio-fails-to-set-the-correct-local-parameter/16212/2 "2020-09-30T03:30:29Z")

</div>

It’s difficult to tell what could be going wrong. I would start by having as many `FMOD.RESULT` checks on any and all FMOD functions it will allow. This should help in tracking down where it’s going wrong.

---

<div class="post-metadata">

**Author:** ![laurganta](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@laurganta](https://qa.fmod.com/u/laurganta)\
**Post date:** [September 30, 2020, 10:44am UTC](https://qa.fmod.com/t/fmod-studio-fails-to-set-the-correct-local-parameter/16212/3 "2020-09-30T10:44:40Z")

</div>

FMOD.Result always shows OK wherever I check, on Unity side.

I found a workaround where I add an extra labeled value in FMOD on top of off (0), on (1) -\> I add ‘buffer’ (2).

With this setup, it works fine to set either 0 and 1.

Regarding using the same approach for the footsteps, it has the same result for the last value of the Surface parameter (7). If I set value 7 from Unity, it doesn’t work. Adding a new labeled value (8) to the Surface parameter, with no change on Unity side, works properly for value 7 (although it wouldn’t work for the value 8, which is a buffer anyway).

So the issue is that the last value from the labeled parameter is ignored on the FMOD Studio side.

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [October 6, 2020, 1:31am UTC](https://qa.fmod.com/t/fmod-studio-fails-to-set-the-correct-local-parameter/16212/4 "2020-10-06T01:31:57Z")

</div>

I’ve been testing this for a while now but I cannot seem to replicate this issue. All labelled and discrete parameters behave as intended with the correct settings and values being returned. The off-by-one issue might be an issue in your code. I would recommend connecting Unity to your Visual Studio session and running a debug session with break points to see exactly where and how you are setting the parameter’s values.

EDIT: I’ve been informed by a fellow developer that there was a fix in FMOD Studio 2.01.03 for labelled/discrete parameters allowing 1 higher values of their max range to be set. Could you please update your FMOD Studio integration to the latest version and see if the same issue happens?
