Parameter Not Changing

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.

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);
        }
    }
}

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

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!