Some of the events don’t play in packaged builds in Unreal Engine and the problem can be found i the log i think.
The FirstPersonCharacter tries to get the fmod events before Fmod is initialized, which fails. I don’t know if it’s my fault or if you can change some settings with Fmod.
The finder will serialize the first person character blueprint, but any FMOD references will fail to load since the FMOD plugin has not been created yet. To make sure that the FMOD plugin is loaded first, add the line of code above the class finder.
I tried this already but then the exe just crashes immediately with this error:
Fatal error: [File:D:\Build++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp] [Line: 661] Compiled in export /Game/FMOD/Events/footsteps/footsteps not found; it was never registered.
(Footsteps is a Fmod event that the First Person Character uses)
in my GameMode.cpp
… #include “FMODBlueprintStatics.h”
// IT CRASHES NEXT LINE
static ConstructorHelpers::FClassFinder PlayerPawnClassFinder(TEXT("/Game/FirstPersonCPP/Blueprints/FirstPersonCharacter"));
However, since updating to 4.18 it crashes in packaged builds. If I do as was suggested by other users and move the IFMODStudioModule::Get() call out of this class and into the InitGame() function of my GameModeBase, it doesn’t crash, but it doesn’t find my events either. According to the log, the events are created after the constructor is of the class in question tries to find the events.
Everything works fine in the editor. (Both, the editor and the game’s project, are built using the “DebugGame Editor” configuration by the way.)
I looked into this some more. As it turns out, InitGame() is called rather late (after the constructor of the UFootstepSoundComponent class). With that in mind it makes sense that the game doesn’t find the events. However, actually ensuring that the fmod plugin is loaded before that like I did in the code above, crashes the game now.