Answered
0
0

Hi! Just set up FMOD in Unity from scratch for the first time. I love the workflow! I’m currently trying to pass through variables, but FMOD does not respond to variable changes. Am I doing something wrong with the following JS? All documentation is in C# so I distilled this example from the Angry Bots project, where it seems to work fine. The Awe parameter is found on the music event, the event is correctly set up in FMOD Studio (responds to changes of the awe parameter in the GUI if I change it manually) and the music is playing as it should.

pragma strict

var awesomeMusic : FMOD.Studio.EventInstance;
var Awe : FMOD.Studio.ParameterInstance;
var aweParam: float;

function Start ()
{
awesomeMusic = FMOD_StudioSystem.instance.GetEvent(“{longcodeyepyep-pastehere}”);
if (awesomeMusic.getParameter(“Awe”, Awe) != FMOD.RESULT.OK)
{
Debug.LogError(“Awe parameter not found on music event”);
return;
}

Awe.setValue(0.0f);

}

function Update ()
{
if (Input.GetKeyDown (“=”))
{
if(aweParam<1.0) aweParam=aweParam+0.05;
print (“Awe “+aweParam);
Awe.setValue(aweParam);
}

if (Input.GetKeyDown ("-"))
{
    if(aweParam>0.0) aweParam=aweParam-0.05;
    print ("Awe "+aweParam);
    Awe.setValue(aweParam);
}

}

  • You must to post comments
Best Answer
0
0

Add awesomeMusic.start() to start the event.

  • You must to post comments
0
0

Thanks, awesomeMusic and parameter now work like a charm! We were triggering the FMOD instance via FMOD_StudioEventEmitter but apparently then the parameters change does not work.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.