UFMODAnimNotifyPlay does not load FMOD event assets, causing them not to play in standalone

For reference, I’m using 4.26 with the latest code from the 4.26 branch on github (fb6c45d5a6d9d6c2051b3b34e54466a83a708bce at the time of writing). I believe this affects older versions, however.

FMOD anim notifies will not work in standalone (packaged or from the editor) if the event they are pointing to hasn’t already been loaded for another reason. Easy repro is to create an event that is only used in a notify, then run the game standalone from the editor.

This is likely due to the UFMODAnimNotifyPlay::Event field being a TAssetPtr/TSoftObjectPtr which results in the event asset never being loaded. Even if the bank the event belongs to is loaded, nothing will tell the engine to load the UFMODAsset since FMOD itself doesn’t care about the unreal asset, resulting in the object pointer never being valid.

The temporary fix I’ve made is to use a hard pointer (UFMODAsset*) instead of a soft pointer, but I’m not sure if that’s the “right” way to fix this.

Thanks for reporting this. Your analysis and fix are spot on - I’ll add your fix to our code.

This actually is introduced in 4.26. In prior versions we were generating the UE4 assets to wrap FMOD studio items on the fly, which meant they were always loaded. As of 4.26 that asset generation is done only in the editor and the generated assets are serialized to be loaded at runtime so strong references are required in places like UFMODAnimNotifyPlay::Event in order to force the required asset to be loaded on demand. We already changed weak references for strong references in most instances but we’d overlooked this one!

1 Like