Unable to call GetEvent on an FMODAsset

Hey!
I can’t seem to be able to call GetEvent, even though the asset clearly exists.

The first thing I tried, was for one-shot sounds to be called using strings (“event:/path/asset”), but that didn’t work, and I kept getting an error.

I then tried to have direct FMODAsset references instead, which works great for one-shot sounds!

But it didn’t work for GetEvent. When I do that, I get an error:
FMOD Error (ERR_EVENT_NOTFOUND): The requested event, bus or vca could not be found.
Which is odd, since I’ve assigned the asset through the inspector. It clearly exists, it can’t even be a typo on my end in this case.

I did notice something about having to load the bank before you use it, but I only found an old thread with code that had to be modified/updated for it to even compile, and when it did compile, it didn’t work :frowning:
Plus, there’s nothing in the Unity Doc about having to load banks in code, and the oneshot sounds work.

Any idea what gives? :slight_smile:

Banks are loaded by adding the FMOD_Listener component to a game object (usually your main camera).

If the FMODAsset works, check your path. Use “Copy as Path” in the context menu on an event in Studio.

Worst case, delete all the .bank files under the “streaming assets” folder and re-import.

I’ve got an FMOD_Listener on an enabled GameObject in my scene.

The FMODAsset works when I preview it with the Play button in the Unity Editor. Also, I’m not sure why I would need to copy the path, I’ve already got a direct reference to the FMODAsset through the inspector, just like I do with the oneshot sounds (which work).

To clarify, here’s my setup:

Check the Unity Script Ordering. Make sure Portal.cs is running after the Listener.

The issue was the order in which things happen, setting FMOD scripts to run before my own solved it in this case.
It seems like there are many things in the FMOD Unity integration that runs in Start() which should rather run in Awake()