error: in FMOD_StudioSystem

Hey folks,

I’m want to change the value of an FMOD-Event but I keep getting the following error messages in Unity:

ERROR1 = “The name `FMOD_StudioSystem’ does not exist in the current context”
and
ERROR2 = “The left-hand side of an assignment must be a variable, a property or an indexer”

the code for that is the following:

private FMOD.Studio.EventInstance boidActive;
private FMOD.Studio.ParameterInstance filter; 

void Start ()
{
	//ERROR MESSAGE 1
	boidActive = FMOD_StudioSystem.instance.GetEvent ("event:/boid_sound");

	if (boidActive.getParameter("filter", out filter) != FMOD.RESULT.OK)
	{
		Debug.LogError("filter parameter not found on boid_sound event");
		return;
	}

	boidActive.start();
}

void Update () 
{
            //ERROR MESSAGE 2
            filter.setValue = (this.transform.position.x);
	Debug.Log(this.transform.position.x);
}

where “boid_sound” is the event in FMOD and “filter” is the parameter I want to control

Any help would be very much appreciated!

cheers,
Simon

FMOD_StudioSystem isn’t the correct class to use, unless it is one you have made yourself.

FMODUnity.RuntimeManager.StudioSystem will give you a reference to the current Studio System, see our docs for more info:
https://www.fmod.com/resources/documentation-api?page=content/generated/engine_new_unity/scripting.html#/

The second issue is that setValue is a function and not a variable, so you would use it like this:

filter.setValue( transform.position.x );

https://www.fmod.com/resources/documentation-api?page=content/generated/FMOD_Studio_ParameterInstance_SetValue.html#/