After packaging my VR game and opening it, it instantly crashes with this error:
Assertion failed: OnRequestDefaultDataInterface.IsBound() [File:D:/Build/++UE4+Licensee/Sync/Engine/Plugins/FX/Niagara/Source/NiagaraShader/Private/NiagaraShaderModule.cpp] [Line: 55]
Can not invoke OnRequestDefaultDataInterface. Delegate was never set.
My game works perfectly fine in the editor with niagara effects in game. I recently upgraded from 4.23 to 4.25 Preview. Does anyone know where I can find some information regarding this?
I have this exact same error, (non-VR) and the issue only occurs when I have Niagara system objects referenced by my actors or data tables. I can spawn niagara systems in Level Blueprints, place them in levels, but put any non-trivial Niagara system as a reference to spawn an emitter and BAM crash on packaged game.
This issue isnāt present on non-packaged builds. Iām on 4.24.3 and this is really painful. I run a source-build of the engine and Iām open to modifying the code just need a hint as to why this error is happening!
Apparently if I make the emitterās CPUSim instead of GPUComp Sim there isnāt an error when running a packaged version. Unfortunately this doesnāt happen in a simple template project so it seems unlikely anyone will be able to investigate this.
We are also having this problem here on 4.24.1 - We have set all effects being referenced to be CPU sim although not ideal for performance and have set fixed bounds to true. We have made sure Niagara is correctly added to the Build.cs Module Dependencies but alas still have this crash on launch of built version of the game. This is getting really costly in terms of our developement time and is stopping us from progressing on the PFX front. Any help past what has been mentioned above would be amazing! Iāve posted an image of our crash even though its identical to the one above.
Just in case it might help anyone else: For some reason this was caused by the gamemode trying to load the player pawn by default. Iāve just uncommented these lines in my gamemode.cpp and that fixed it for me. I assume it has something to do in which order Niagara + Pawn are loaded etc.
I stumbled upon this running the game via Visual Studio, with the Local Windows Debugger attached. Similar to what was suggested here by āScapiorā:
Just following this up in case some other lost soul finds their way here: Tobiasā solution worked for me as well, but UE4 makes the cause of this issue a bit deceptive.
Unreal pretends itās a Niagara issue, but it is not. Additionally, the code in the screenshot above is located in the automatically generated GameMode class that UE4 created for you upon project creation, which isnāt necessarily the GameMode class youāre actively using. Launching the project through Visual Studio following the steps CraveTheGrave helped me diagnose the problem and find that code listed above.
The Problem:
In the case of Tobias and I, the issue seems to be UE4 trying to load an asset that is not packaged with the project. In my case, it was trying to load the ThirdPersonCharacter thatās provided by default (which is no longer packaged with my game).
The Solution:
Go to the GameMode class that UE4 automatically created for your project, for example MyProjectGameMode.h (it should be at the root of your projectās source folder), and either comment out that entire constructor (like Tobias did), or replace the path to a pawn thatās packaged with your game.
Hereās an example of what mine looks like (be sure to change the āTEXTā part to point to a pawn in your own project. I made mine point to an empty pawn blueprint I made):
AMyProjectGameMode::AMyProjectGameMode()
{
// set default pawn class to our Blueprinted character
static ConstructorHelpers::FClassFinder<APawn> PlayerPawnBPClass(TEXT("Blueprint'/Game/Blueprints/Characters/EmptyPawn.EmptyPawn_C'"));
if (PlayerPawnBPClass.Class != NULL)
{
DefaultPawnClass = PlayerPawnBPClass.Class;
}
}
NOTE: If you do change the path to point to a blueprint class, be sure the extension ends in ā_Cā. Otherwise UE4 will say it could not find the file. āCopy Referenceā does not do that for you.