# Event Callbacks for different callback types

**URL:** <https://qa.fmod.com/t/event-callbacks-for-different-callback-types/21806>\
**Category:** Unity\
**Created:** [June 25, 2024, 5:13pm UTC](https://qa.fmod.com/t/event-callbacks-for-different-callback-types/21806 "2024-06-25T17:13:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spakment](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@spakment](https://qa.fmod.com/u/spakment)\
**Post date:** [June 25, 2024, 5:13pm UTC](https://qa.fmod.com/t/event-callbacks-for-different-callback-types/21806/1 "2024-06-25T17:13:29Z")

</div>

Hi,  
Is it possible to setup multiple callbacks on events,  
eg different callbacks for differnt EVENT\_CALLBACK\_TYPEs?

Or is it only possible to have a single callback on an event?

Just looking for some clarity as I’m unclear on this from the docs.

I’m trying to setup a callback for programmer instruments and a diffferent callback for markers and beats, eg something along the lines of this:

```auto
instrumentCallback = new FMOD.Studio.EVENT_CALLBACK(InstrumentEventCallback);

eventInstance.setCallback(instrumentCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.CREATE_PROGRAMMER_SOUND | EVENT_CALLBACK_TYPE.DESTROY_PROGRAMMER_SOUND);

eventCallback = new FMOD.Studio.EVENT_CALLBACK(BeatEventCallback);
            
eventInstance.setCallback(eventCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER);

```

thanks all

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [June 28, 2024, 3:52am UTC](https://qa.fmod.com/t/event-callbacks-for-different-callback-types/21806/2 "2024-06-28T03:52:07Z")

</div>

Hi,

Thank you for sharing the code.

> [@spakment](#):
>
> Is it possible to setup multiple callbacks on events,
> 
> eg different callbacks for differnt EVENT\_CALLBACK\_TYPEs?
> 
> Or is it only possible to have a single callback on an event?

It is indeed possible to set up multiple callbacks flags on the same event instance. I would suggest you to have a look at a similar post which I will link here:

> [@(C#) Calling EventInstance::setCallback with various callbackmasks results in only the last one working](https://qa.fmod.com/t/c-calling-eventinstance-setcallback-with-various-callbackmasks-results-in-only-the-last-one-working/12610/2):
>
> There can only be one callback delegate registered per event. If you wish to receive multiple types of events OR them together. instance.setCallback(m\_delegate1, EVENT\_CALLBACK\_TYPE.STOPPED | EVENT\_CALLBACK\_TYPE.CREATED); The specific event that triggered the callback is passed as an argument.

Hope it helps, let me know if you have any questions.
