Similar to Scriptable Objects in Unity, we can organize FMOD Assets in an asset file named Data Asset. These are simple assets that can can store data references. We can use Data Assets to store references to our FMOD Events.
What are the benefits of using Data Assets?
For example, if we select FMOD Events directly in the Blueprint nodes provided by the FMOD Integration and later decide to change our Event names or Event structure in the FMOD Studio project, we will lose the references to the Events and have to update all the FMOD nodes. By using Data Assets, we can store the Event references in one central asset and update only that file if we need so.
Creating a Data Asset for storing FMOD Events in Unreal Engine 4
Add a new Blueprint Class and select Primary Asset Data from the class list:
Name the new Blueprint Class something like PlayerAudioData (for a hypothetical player sound sheet) and open the Blueprint.
In the Blueprint EventGraph, create a new variable and select FMODEvent as a variable type. Repeat this step for each sound. For this tutorial I will create three variables named Jump, Run and Attack:
Compile the Blueprint and now create a new Data Asset by clicking with the right mouse button on the Content Browser and selecting Miscellaneous->Data Asset. In the Pick Data Asset window, select the Blueprint Class we created earlier, namely PlayerAudioData. Give the new Data Asset an unique name, I will name the asset PlayerAudio. By opening the Data Asset, you will find the three variables you created in the Blueprint class with empty FMOD Event references:
Select your desired FMOD Event for each variable and save the Data Asset. In every new Blueprint you want to play FMOD Events, you can reference the Data Asset by creating a new Variable and selecting the Data Asset Class as the variable type (in our case PlayerAudioData). Compile the Blueprint and select the Data Asset as the default value:
We can now drag the Data Asset Class variable to the Blueprint and get every FMOD Event we specified in the initial Data Asset Class by using the Get node:
As you see in this image, we can get and attach the Event from the Data Asset to the Event Object Reference in a Play Event 2D node for example. If we need to change the Event names or reorganize the project in FMOD Studio, we simply need to update the Events location in the Data Asset instead of looking for each occurrence in different Blueprints nodes.