Answered
0
0

Another pro-tip here collected from a lot of searching:

To trigger ANY cue on an event created in FMOD Studio and refernced with C# in unity, you have to work around two weird things:

First, all cues are called "KeyOFF". So don’t go around trying to get cue "A", because it’s called "KeyOFF".

SECOND, cue.trigger() does not exist, and harks back to a c++ typo from 2008 somehow. To trigger your cue, you must instead call cue.setValue(float), which doesn’t set any value and disregards that value and is actually going to trigger your cue.

So, if "zoom" is your EventInstance

[code:29homvyu]FMOD.Studio.CueInstance cue;
zoom.getCue("KeyOFF",out cue);
if ( cue!=null ) { //not needed check, but prolly a good idea
cue.setValue(0f);
}[/code:29homvyu]

You have successfully triggered Cue A.

  • You must to post comments
Best Answer
1
0

Did anyone ever solve this issue? I am having the same issue as João.

  • Nicholas Wilcox

    CueInstance.trigger() is part of the API now. The Cue (there is only ever 0 or 1) is still always called “KeyOFF”.

  • Stephen Foster

    Apologies, the issue for me here was that the event was looped in FMOD Studio. Removing the loop section fixed the issue. Interestingly, the loop didn’t apply to the event in FMOD Studio, but instead prevented the event from continuing when trigger() was called in engine.

  • You must to post comments
0
0

A quick note here…

I have just needed to do exactly this, trigger a cue. Using FMOD 1.03.01 it seems that – cue.setValue(0f); – does NOT trigger the cue for me (gives error).

Instead, I used – cue.trigger(); – and it works.

  • You must to post comments
-1
0

nice! my version didn’t have this function for some reason.

  • You must to post comments
-1
0

I haven’t got so far yet, but thanks for sharing, knowing this could save a lot of time and headaches!

  • You must to post comments
0
0

the method setValue doesn’t exist anymore, I used trigger() as said above but this didn’t do anything. Is there anything more that needs to be done??

This is my code:

FMOD.Studio.CueInstance cue;

var pauseEvent = FMOD_StudioSystem.instance.GetEvent(“event:/”+ResourceData.PAUSE_SOUND);

pauseEvent.getCue(“KeyOFF”, out cue);

if (cue != null)
{
cue.trigger();
}

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.