Crash when trying to Add to Viewport widget with NiagaraSystemWidget placed on it.
Interestingly, it work for the main menu of the game, but the crash occurs due to the HUD during the game.
-
In Level blueprint of the Main Menu level, I Cast to Game Instance and trigger its Custom Event which is Create Menu Widget, Add it to viewport, also Create HUD Widget.
And it works. -
However, when I click the button to open the first normal level of the game, the Construction Script of my main character Cast to Game Instance and launches a Custom Event similar to the menu, which here is only Add to Viewport of an already created HUD Widget.
Now the program crashes. Node Is Valid doesn’t seem to help.
But, If I add a Delay for a second before this Add to Viewport, then the crash doesn’t occur!
Without Niagara there is no error and everything works. Sometimes only when I make some changes the HUD stops working and I have to restart the whole program, probably to reset Game Instance.
Here is crash log;
> LoginId:7d8bc63d484c2936f54b9db9670b10a4
> EpicAccountId:1fb6140f70ba41b09cca427c7009baa9
>
> Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000250
>
> UE4Editor_NiagaraUIRenderer!AActor::ForEachComponent_Internal<UNiagaraUIComponent,0,0,<lambda_9caae4225cc5c417bc67b10a19a36ad4> >() [D:\RocketSync\4.27.0-17155196+++UE4+Release-4.27\Working\Engine\Source\Runtime\Engine\Classes\GameFramework\Actor.h:3006]
> UE4Editor_NiagaraUIRenderer!ANiagaraUIActor::SpawnNewNiagaraUIComponent() [D:\build\++Portal\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\NiagaraUIRenderer\Source\NiagaraUIRenderer\Private\NiagaraUIActor.cpp:20]
> UE4Editor_NiagaraUIRenderer!UNiagaraSystemWidget::InitializeNiagaraUI() [D:\build\++Portal\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\NiagaraUIRenderer\Source\NiagaraUIRenderer\Private\NiagaraSystemWidget.cpp:86]
> UE4Editor_NiagaraUIRenderer!UNiagaraSystemWidget::RebuildWidget() [D:\build\++Portal\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\NiagaraUIRenderer\Source\NiagaraUIRenderer\Private\NiagaraSystemWidget.cpp:20]
> UE4Editor_UMG
> UE4Editor_UMG
> UE4Editor_UMG
> UE4Editor_UMG
> UE4Editor_UMG
> UE4Editor_UMG
> UE4Editor_UMG
> UE4Editor_UMG
> UE4Editor_UMG
> UE4Editor_CoreUObject
> UE4Editor_CoreUObject
> UE4Editor_CoreUObject
> UE4Editor_CoreUObject
> UE4Editor_CoreUObject
> UE4Editor_CoreUObject
> UE4Editor_CoreUObject
> UE4Editor_CoreUObject
> UE4Editor_CoreUObject
> UE4Editor_CoreUObject
> UE4Editor_CoreUObject
> UE4Editor_CoreUObject
> UE4Editor_CoreUObject
> UE4Editor_CoreUObject
> UE4Editor_Engine
> UE4Editor_Engine
> UE4Editor_Engine
> UE4Editor_Engine
> UE4Editor_Engine
> UE4Editor_Engine
> UE4Editor_Engine
> UE4Editor_Engine
> UE4Editor_Engine
> UE4Editor_Engine
> UE4Editor_UnrealEd
> UE4Editor_UnrealEd
> UE4Editor
> UE4Editor
> UE4Editor
> UE4Editor
> UE4Editor
> UE4Editor
> kernel32
> ntdll