ApexAsset for DestructibleMesh not loading on cooked game, but does on play in editor
After migrating to UE 4.18 all destructible meshes in our game stopped working, except when running the game on PIE.
Debugging a little bit, I found at the moment of deserializing in UDestructibleMesh::Serialize the deserialized ApexAsset is NULL if running as cooked standalone game, but deserializes correctly if running from editor.
The cooking process didn't give me any warning regarding destructible meshes. Any idea what I should be looking into?
Debugging further I've found the NvParameterized serializer didn't have the factory for "DestructibleAssetParameters" version 26 registered at the time of loading the destructible mesh assets.
Seems like the reason our destructible meshes are working fine when running from Editor is because Apex Destruction is properly initialized before the game assets are loaded, however, when running standalone (a configuration without editor) the game assets are loaded before FApexDestructionModule::StartupModule is called.
Is there a way I can force the module to load first?
I actually found a workaround for this issue. It is critical that the destructible mesh not be referenced is not referenced (even indirectly) by a character or other startup asset. Since this makes it impossible to keep a proper reference, I'm instead keeping a FString reference and then loading it when it's needed using StaticLoadClass like so:
It's ugly, and may put undue stress on the HDD but technically it works.
Follow this question
Once you sign in you will be able to subscribe for any updates here