# EventInstance.SetParameterByName not working

**URL:** <https://qa.fmod.com/t/eventinstance-setparameterbyname-not-working/18118>\
**Category:** Unity\
**Tags:** unity, csharp\
**Created:** [December 20, 2021, 4:18pm UTC](https://qa.fmod.com/t/eventinstance-setparameterbyname-not-working/18118 "2021-12-20T16:18:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wicher95](https://avatars.discourse-cdn.com/v4/letter/w/848f3c/32.png) [@Wicher95](https://qa.fmod.com/u/Wicher95)\
**Post date:** [December 20, 2021, 4:18pm UTC](https://qa.fmod.com/t/eventinstance-setparameterbyname-not-working/18118/1 "2021-12-20T16:18:12Z")

</div>

Hi,

I can’t get to work setting parameters to EventInstance, every parameter value is set to 0 even just after setting it to 1 and reading value of it.

Here is the code I’m using:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/1/1028ea003d7359e6f58ae40218fce37c89f3aba0.png)

---

<div class="post-metadata">

**Author:** ![Wicher95](https://avatars.discourse-cdn.com/v4/letter/w/848f3c/32.png) [@Wicher95](https://qa.fmod.com/u/Wicher95)\
**Post date:** [December 20, 2021, 4:19pm UTC](https://qa.fmod.com/t/eventinstance-setparameterbyname-not-working/18118/2 "2021-12-20T16:19:36Z")

</div>

Logs from editor:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/b/b6c7a85377d786bb25ba1d7c7c190c760a69350b.png)

As you can see, the FTS\_Grass is set to 1 but reading it returns 0

---

<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:** [December 21, 2021, 12:57am UTC](https://qa.fmod.com/t/eventinstance-setparameterbyname-not-working/18118/3 "2021-12-21T00:57:52Z")

</div>

Is the event itself behaving in a way that the parameter value is actually set to 1? It is quite likely the debug log is reading the parameter value too quickly - it is being read in the same update as being set to a non-default value.

---

<div class="post-metadata">

**Author:** ![Wicher95](https://avatars.discourse-cdn.com/v4/letter/w/848f3c/32.png) [@Wicher95](https://qa.fmod.com/u/Wicher95)\
**Post date:** [December 21, 2021, 6:33am UTC](https://qa.fmod.com/t/eventinstance-setparameterbyname-not-working/18118/4 "2021-12-21T06:33:18Z")

</div>

The event is not working correctly, in FMOD profiler the event is fired but all parameters are set to 0 and there is no sound.

---

<div class="post-metadata">

**Author:** ![Wicher95](https://avatars.discourse-cdn.com/v4/letter/w/848f3c/32.png) [@Wicher95](https://qa.fmod.com/u/Wicher95)\
**Post date:** [December 21, 2021, 9:10am UTC](https://qa.fmod.com/t/eventinstance-setparameterbyname-not-working/18118/5 "2021-12-21T09:10:10Z")

</div>

Ok, the problem was in my code, I set FTS\_Grass multiple times by mistake, so it first got 1 and after that it was set back to 0.
