Using scripts to trigger parameters in Unity

Hi,

I’m using a plugin called Panoply to create an interactive graphic novel for my Masters project. As it only uses cameras and no player characters I’m having difficulty figuring out how to trigger parameters using scripts.

Any help would be immensely appreciated!

public class MUSIC1VERSE : MonoBehaviour

{

    void Start()
    {
        PanoplyEventManager.OnTargetStepChanged += HandleTargetStepChanged;
    }

    public void HandleTargetStepChanged(int oldStep, int newStep)
    {
        if (newStep == 5)
        {
            GetComponent<FMODUnity.StudioParameterTrigger>().TriggerParameters();
        }
    }

}

}

Thanks,

Dan

Using FMODUnity.StudioParameterTrigger.TriggerParameters() will activate the parameter changes that have been made to the parameter values on the StudioParameterTrigger script.
To adjust these values in code you would have to access the Params array, find the name of the parameter you want and set the value, then call TriggerParameters to set the parameters on the event.

StudioEventEmitters have a public function available, SetParameter() that can be used to set a parameter on the fly at runtime.

The other way would be to use the create and control your own Event Instances using the FMODUnity.RuntimManager. From there you will be able to call setParameterValue on the instance.