# Triggering sustain or cue, Unity C#, FMOD Studio

**URL:** <https://qa.fmod.com/t/triggering-sustain-or-cue-unity-c-fmod-studio/11296>\
**Category:** Unity\
**Created:** [February 23, 2014, 2:06am UTC](https://qa.fmod.com/t/triggering-sustain-or-cue-unity-c-fmod-studio/11296 "2014-02-23T02:06:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![arckex](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@arckex](https://qa.fmod.com/u/arckex)\
**Post date:** [February 23, 2014, 2:06am UTC](https://qa.fmod.com/t/triggering-sustain-or-cue-unity-c-fmod-studio/11296/1 "2014-02-23T02:06:42Z")

</div>

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

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

You have successfully triggered Cue A.

---

<div class="post-metadata">

**Author:** ![arckex](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@arckex](https://qa.fmod.com/u/arckex)\
**Post date:** [April 4, 2014, 5:04am UTC](https://qa.fmod.com/t/triggering-sustain-or-cue-unity-c-fmod-studio/11296/2 "2014-04-04T05:04:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jsayre](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@jsayre](https://qa.fmod.com/u/jsayre)\
**Post date:** [March 28, 2014, 5:51pm UTC](https://qa.fmod.com/t/triggering-sustain-or-cue-unity-c-fmod-studio/11296/3 "2014-03-28T17:51:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![CinnoMan](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@CinnoMan](https://qa.fmod.com/u/CinnoMan)\
**Post date:** [February 23, 2014, 10:42pm UTC](https://qa.fmod.com/t/triggering-sustain-or-cue-unity-c-fmod-studio/11296/4 "2014-02-23T22:42:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JCBica](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@JCBica](https://qa.fmod.com/u/JCBica)\
**Post date:** [October 23, 2014, 7:51pm UTC](https://qa.fmod.com/t/triggering-sustain-or-cue-unity-c-fmod-studio/11296/5 "2014-10-23T19:51:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ffsteve](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@ffsteve](https://qa.fmod.com/u/ffsteve)\
**Post date:** [January 20, 2016, 9:54am UTC](https://qa.fmod.com/t/triggering-sustain-or-cue-unity-c-fmod-studio/11296/6 "2016-01-20T09:54:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [January 20, 2016, 11:51pm UTC](https://qa.fmod.com/t/triggering-sustain-or-cue-unity-c-fmod-studio/11296/7 "2016-01-20T23:51:15Z")

</div>

> [@](#):
>
> Did anyone ever solve this issue? I am having the same issue as João.

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

---

<div class="post-metadata">

**Author:** ![ffsteve](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@ffsteve](https://qa.fmod.com/u/ffsteve)\
**Post date:** [January 22, 2016, 5:54pm UTC](https://qa.fmod.com/t/triggering-sustain-or-cue-unity-c-fmod-studio/11296/8 "2016-01-22T17:54:57Z")

</div>

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.
