Plain headphones and a small speaker on an oak desk are joined by one clay-orange cable.
| | |

Game Audio with FMOD – Integration Guide for Unity and Godot

You already have a built FMOD event in a bank, so now you get FMOD for Unity reading that bank and make one event play when something happens in your game.

This is the Unity-only, one-event version of the FMOD handoff, not the Godot plugin walkthrough in post 173 and not the FMOD Studio design overview in post 134.

You will not build events, parameters, or buses here. You will not set up a second engine. You will do four things in Unity: install the integration, point it at your banks, add something that plays your event, and confirm you hear it.

Everything below was checked against FMOD’s Unity integration docs for version 2.03 during this session. The docs site also lists a newer version in its version selector. Open the docs for the version you install, and if a menu or field name below does not match, follow the docs.

What you need before you start

  • A Unity project.
  • An FMOD Studio project with one event assigned to a bank.
  • Built banks from that project.
  • The event’s path. Every event has one, starting with event:/. Copy it exactly, with the same capitals and spaces.

FMOD’s user guide warns that the plugin must use the same major version as your FMOD Studio project, or it will be unable to load the banks. Check your Studio version now and keep it in mind for the next step.

Step 1: Install FMOD for Unity

FMOD’s user guide describes installing the FMOD for Unity package from the Unity Asset Store and importing all of its assets. If the Asset Store version does not match your Studio version, the guide says you can download a matching package from FMOD’s downloads page and import it as a custom package.

After the import, the integration tutorial describes a Setup Wizard that walks you through a few choices. Two of them matter for this article:

  • Pointing the plugin at your FMOD content.
  • Replacing Unity’s listener with FMOD’s listener.

The wizard also offers to disable Unity’s built-in audio. FMOD recommends this to prevent conflicts, and its troubleshooting page lists a start-up message about output being forced to no sound that can come from the two systems clashing. For a one-event test, accepting the recommendation is the simplest path.

To confirm which plugin version you installed, the troubleshooting page points to FMOD > About Integration.

Step 2: Point the plugin at your banks

Open FMOD > Edit Settings. The user guide says this shows the plugin’s settings in the Inspector. Pick a Source Type:

  • FMOD Studio Project if you want Unity to find banks inside your Studio project folder. Everyone on your team then needs access to that project.
  • Single Platform Build if you have one folder of built .bank files. This fits a one-event test well.
  • Multiple Platform Build if you build separate banks per platform.

Click Browse and pick the project file or the bank folder.

Two notes from the guide help here. Do not put an FMOD Studio project inside Unity’s Assets folder, because Unity will try to import it. Banks themselves can live inside Assets. If you keep the source files in a folder at the top level of your Unity project, the plugin stores a relative path, so the project still works after you move it.

By default, the guide says FMOD for Unity loads all banks when it initializes. Leave that alone for now. Loading only some banks is a later problem.

Step 3: Add the listener

FMOD’s game components page says the FMOD Studio Listener must be on your camera for 3D events to pan correctly. If the wizard did not add it, select your main camera, click Add Component, and add it.

The same page notes that if no listener exists when a scene starts, one is created. Adding it yourself means you know where it is.

Step 4: Add an emitter for your one event

Pick the object the sound should come from, such as a door or a switch.

  1. Click Add Component and add FMOD Studio Event Emitter. The integration tutorial shows it under the FMOD Studio group.
  2. Set the event. The docs say you can type the full event:/ path, click the search icon to browse, or drag the event from the FMOD Event Browser, which you open from FMOD > Event Browser.
  3. Choose when it plays with the Event Play Trigger field.

You can also skip the first two steps. The user guide says dragging an event from the Event Browser into the Scene window creates a new object with an emitter already set to that event.

Step 5: Choose a trigger

The emitter’s trigger list maps to normal Unity events. The docs describe options including Object Start, Trigger Enter and Trigger Exit, their 2D versions, collision enter and exit, and mouse events.

For a quick first test, set Event Play Trigger to Object Start. Press play and you should hear the event when the scene loads. This proves the banks, event path, and listener all work.

Then switch to something that feels like a game. For a door:

  1. Add a collider to the door object and tick Is Trigger.
  2. Set Event Play Trigger to Trigger Enter.
  3. If only the player should set it off, the docs say you can choose a tag. Give your player the tag you pick.

For a 2D game, use the 2D trigger options and a 2D collider instead.

Step 6: Or play it from your own script

If you would rather call the sound from code, FMOD’s docs give two routes.

Through the emitter. Set the emitter’s play trigger to None. The game components page then shows calling play from a script on the same object:

using UnityEngine;

public class DoorSound : MonoBehaviour
{
    FMODUnity.StudioEventEmitter emitter;

    void Awake()
    {
        emitter = GetComponent<FMODUnity.StudioEventEmitter>();
    }

    public void OnDoorOpened()
    {
        emitter.Play();
    }
}

Call OnDoorOpened from wherever your door already opens.

Without an emitter. FMOD’s basic scripting example uses an EventReference field, which gives you the event picker in the Inspector, and RuntimeManager.PlayOneShot to play it at a position:

using UnityEngine;

public class DoorOneShot : MonoBehaviour
{
    public FMODUnity.EventReference doorEvent;

    public void OnDoorOpened()
    {
        FMODUnity.RuntimeManager.PlayOneShot(doorEvent, transform.position);
    }
}

The example describes one-shots as sounds with a finite length that play to completion and release their resources. That suits a door.

If your scripts sit in their own assembly definition, the integration tutorial shows adding a reference to the FMODUnity assembly before your code can see these types.

Step 7: If you hear nothing

Check FMOD’s troubleshooting page in order:

  • Read the Unity Console. The docs say FMOD’s logs appear there, and you can raise the logging level in the settings.
  • EventNotFoundException. The docs list three checks. The event is assigned to a bank in Studio. That bank is being loaded. Code that loads banks runs before code that looks up the event.
  • Events not found by path. The docs say this usually means the strings bank is not loaded. Path lookups need it.
  • Version mismatch. Plugin and Studio major versions must match.
  • Old banks. Rebuild in FMOD Studio after any change. The integration tutorial shows Unity noticing the rebuild and refreshing banks.
  • Trigger never fires. Make sure the collider is a trigger, the player has the tag you chose, and the object entering has the physics setup Unity needs for trigger events.

Step 8: Check a build, not just the editor

The editor and a built player load banks differently. FMOD’s source control notes say that with the Streaming Assets import type, the plugin copies .bank files into the StreamingAssets folder at build time so standalone builds contain them.

Make one build and run it outside the editor. Walk into your trigger. If you hear the event there too, the handoff is done.

What comes next

Commit your project now, while one event works end to end. Then repeat the same steps for a second sound. Parameters, snapshots, and controlling bank loading are all covered in the same FMOD for Unity docs, and each is easier once you trust this first path.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *