# Parameter Not Changing

**URL:** <https://qa.fmod.com/t/parameter-not-changing/17489>\
**Category:** Unity\
**Tags:** csharp\
**Created:** [July 28, 2021, 11:21pm UTC](https://qa.fmod.com/t/parameter-not-changing/17489 "2021-07-28T23:21:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fonics](https://avatars.discourse-cdn.com/v4/letter/f/9fc348/32.png) [@Fonics](https://qa.fmod.com/u/Fonics)\
**Post date:** [July 28, 2021, 11:21pm UTC](https://qa.fmod.com/t/parameter-not-changing/17489/1 "2021-07-28T23:21:53Z")

</div>

I’ve been trying at this for a long time, looking at everything I can find online and for some reason it’s just not working. From everything I’ve found this should work, but it just won’t! Any help understanding exactly how to access and change parameters while the event is active would be greatly appreciated.

```auto
public class testscript : MonoBehaviour
{
    public StudioEventEmitter studioEventEmitter;

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.I))
        {
            studioEventEmitter.Play();
        }
        if (Input.GetKeyDown(KeyCode.O))
        {
            studioEventEmitter.EventInstance.setParameterByName("LoopStop", 1f);
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [July 30, 2021, 3:13am UTC](https://qa.fmod.com/t/parameter-not-changing/17489/2 "2021-07-30T03:13:05Z")

</div>

This is exactly how parameters should be working, and I have run your script and confirmed it is behaving as expected. Some things to double check:

- Confirm you’ve got the right parameter name and that it exists on the event you are using
- Confirm the range of values it accepts
- Confirm “LoopStop” will do what you expect it to do in FMOD Studio
- Make sure you are definitely adding a reference to the StudioEventEmitter in Unity
- Test with our Example project- I loaded in “event:/Ambience/City” and changed “LoopStop” to “Traffic” and set the value to 10f to make sure it would be a very obvious change

---

<div class="post-metadata">

**Author:** ![Fonics](https://avatars.discourse-cdn.com/v4/letter/f/9fc348/32.png) [@Fonics](https://qa.fmod.com/u/Fonics)\
**Post date:** [July 30, 2021, 3:58am UTC](https://qa.fmod.com/t/parameter-not-changing/17489/3 "2021-07-30T03:58:39Z")

</div>

I have it working as expected now, It wasn’t working due to my misunderstanding of how setting up parameters worked. I wasn’t using the green range indicator properly, so the value I was setting it to was within the range to continue triggering the instrument. Thanks for testing it and for the help!
