Timeline Callbacks with Markers

Hey guys!

I’m working with FMOD only a few days now and it’s really cool what you can do with it!
So I started tinkering with the code and looked at this Tutorial about the Timeline Callbacks.

It works, but has some limitations than I would like to remove.

I have a single ambient track, that does not play from the beginning. So the player needs to start it by walking into a trigger.

The code in the Callback Tutorial starts the event of the given path right away.
What I am trying to figure out is the following:

Can I create and start a MusicInstance in the TimelineCallback Script when the Start of an Event is Triggered on the Object with an Emitter [start TriggerEnter] attached?

I tried to move everything from the Start() in the TimelineCallback Script to a new Function called CreateNewMusicInstance(string eventPath) to submit the path of the triggered Emitter event.

But how can I track when an EmitterStartEvent is Triggered and grab the EventPath to give it to my TimelineCallback Script?

It sounds like you want to use the timeline callbacks on an event that starts on a trigger.

If that is the case, check out unity’s OnTriggerEnter function. You can leave the majority of the code in the Start function and just move the musicInstance.start() to OnTriggerEnter().

If you want to be able to use events similar to the Event Emitter script, have a look at our other Scripting pages. It’s fairly easy to create your own scripts by looking at the code from the scripts we provide and using what you need.