Creating two FMOD events in a single Unity Object

Hi there,

I am new to FMOD, and I started following the survival shooter tutorial to learn more about the audio implementation.

Is anyone familiar with these tutorial series? If so, I would like to ask how I attach two FMOD events in a single object. For instance, in the tutorial, the guy has attached two FMOD events (hurt and death sound) to the player’s health script, but he does not explain how he created it.

I would like to apply the same thing to enemies’ hurt and death sound.

You can add as many Event Emitter components or as many calls to events in scripting as you need. In scripting you can use [FMODUnity.EventRef] public string eventPath; to expose the event selector and you can have as many of these as you want as long as the eventPath variable is different for each call.

In terms of the Survival Shooter tutorial, these two events are called for the enemies via a function call in the death animation. See 7:19 of the tutorial.

At 11:54 you will also hear Daniel mention that for calling multiple events he will talk about this in the music system. At 9:47 of the music tutorial you can see in his script that he uses the FMODUnity.RuntimeManager.PlayOneShot() function to grab the public string that I mentioned above.