# Can't change parameters

**URL:** <https://qa.fmod.com/t/cant-change-parameters/14250>\
**Category:** Unity\
**Created:** [December 12, 2018, 7:03pm UTC](https://qa.fmod.com/t/cant-change-parameters/14250 "2018-12-12T19:03:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HaveACookie](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@HaveACookie](https://qa.fmod.com/u/HaveACookie)\
**Post date:** [December 12, 2018, 7:03pm UTC](https://qa.fmod.com/t/cant-change-parameters/14250/1 "2018-12-12T19:03:39Z")

</div>

Hello,  
I have a project in fmod where I’m trying to change a parameter on trigger enter in a script. The issue is that even though the variable that should make my sound play returns true, my sounds still don’t play. This is my code:  
using System.Collections;  
using System.Collections.Generic;  
using UnityEngine;

public class WalkTriggers : MonoBehaviour {  
public bool section1 =false;  
public bool section2;  
public bool section3;  
public bool section4;  
public bool section5;  
// Use this for initialization

```
[FMODUnity.EventRef] public string Spencer;
private FMOD.Studio.EventInstance harpLoopInstance;
void Start () {
    harpLoopInstance = FMODUnity.RuntimeManager.CreateInstance(Spencer);
    harpLoopInstance.setVolume(0.0f);
    harpLoopInstance.start();
    

}

// Update is called once per frame
void Update () {

    if(section1 == true)
    {
        harpLoopInstance.setVolume(1.0f);
       
        Debug.Log("yay");
        harpLoopInstance.setParameterValue("Harp Volume", 1);
       
    }
    
}

private void OnTriggerEnter(Collider collider)
{
    if (collider.gameObject.tag == "Trigger1")
    {
        section1 = true;
        harpLoopInstance.setParameterValue("Harp Volume", 1);
        harpLoopInstance.setParameterValue("Drum Volume", 0);
        harpLoopInstance.setParameterValue("Strings Volume", 0);
        harpLoopInstance.setParameterValue("Flute Volume", 0);
    }
}

```

}

Does anyone have any idea why its behaving this way?

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [December 17, 2018, 4:06am UTC](https://qa.fmod.com/t/cant-change-parameters/14250/2 "2018-12-17T04:06:54Z")

</div>

Are you getting any errors or warnings in the console log?

---

<div class="post-metadata">

**Author:** ![HaveACookie](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@HaveACookie](https://qa.fmod.com/u/HaveACookie)\
**Post date:** [December 17, 2018, 5:03am UTC](https://qa.fmod.com/t/cant-change-parameters/14250/3 "2018-12-17T05:03:19Z")

</div>

No I’m Not getting anything in the console

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [December 18, 2018, 3:20am UTC](https://qa.fmod.com/t/cant-change-parameters/14250/4 "2018-12-18T03:20:35Z")

</div>

The setParameter function will return a FMOD\_RESULT, if you can check this it may help figure out the problem.
