Description

Currently, Niagara Components are only expected to have their TickComponent() method called when their system is marked as "Solo", which makes them be simulated individually. In the most common scenario, however, systems are not "Solo" and are ticked as a batch from FNiagaraWorldManager::Tick(). Note that function UNiagaraComponent::TickComponent() checks that it is being called only on "Solo" systems, and asserts otherwise. Also, UNiagaraComponent::UpdateInstanceSoloMode() forcefully calls SetComponentTickEnabled() to match the state of RequiresSoloMode() when the component is active.

The problem arises from the combination of the behaviors above and the fact that the user is also allowed to turn the component tick on and off by using SetComponentTickEnabled() in C++ or BP during runtime, or by checking option "Start with Tick Enabled" in the Editor Details Panel for the component. If the user enables the component tick in some way while the system is not marked as "Solo", the assertion will trigger inside UNiagaraComponent::TickComponent().

In some discussions linked by the associated UDN case, a workaround was presented: UNiagaraComponent could override SetComponentTickEnabled() and use SetPaused() instead of Super::SetComponentTickEnabled() when not in Solo mode. However, no solution seems to have been integrated in ue-main so far. Also, this proposed workaround does not address checking option "Start with Tick Enabled" in the Editor.

Note that class UParticleSystemComponent, used by the old Cascade system, successfully deals with the same kind of problem by overriding SetComponentTickEnabled(), PostEditChangeChainProperty(), PostLoad(), OnRegister() and handling the necessary special cases therein. For example, in many cases it forcefully disables "bStartWithTickEnabled" when ShouldBeTickManaged() returns true.

Steps to Reproduce

1. Create an Actor Blueprint
2. Edit the Blueprint and add a NiagaraComponent to it
3. Select the NiagaraComponent. On the details panel:
3.1. Assign any NiagaraSystem to the "Niagara System Asset" field
3.2. Check "Start With Tick Enabled" --> instantly triggers ASSERTION FAILED

Note: A similar crash with a similar call stack can be reproduced in PIE by calling SetComponentTickEnabled(true) in BeginPlay(), for example.

Callstack

Assertion failed: SystemInstanceController->IsSolo() File:...\Engine\Plugins\FX\Niagara\Source\Niagara\Private\NiagaraComponent.cpp [Line: 841]

UnrealEditor_Niagara!UNiagaraComponent::TickComponent() [...\Engine\Plugins\FX\Niagara\Source\Niagara\Private\NiagaraComponent.cpp:841]
UnrealEditor_Engine!UE::Trace::Private::FLogScope::Enter<FMetadataAssetFields>() [...\Engine\Source\Runtime\Engine\Classes\GameFramework\Actor.h:4573]
UnrealEditor_Engine!FActorComponentTickFunction::ExecuteTick() [...\Engine\Source\Runtime\Engine\Private\Components\ActorComponent.cpp:1170]
UnrealEditor_Engine!FTickFunctionTask::DoTask() [...\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:278]
UnrealEditor_Engine!TGraphTask<FTickFunctionTask>::ExecuteTask() [...\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:1235]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksNamedThread() [...\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:760]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [...\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:651]
UnrealEditor_Core!FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete() [...\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:2122]
UnrealEditor_Engine!FTickTaskSequencer::ReleaseTickGroup() [...\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:556]
UnrealEditor_Engine!FTickTaskManager::RunTickGroup() [...\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:1583]
UnrealEditor_Engine!UWorld::RunTickGroup() [...\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:772]
UnrealEditor_Engine!UWorld::Tick() [...\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:1499]
UnrealEditor_Kismet!FSCSEditorViewportClient::Tick() [...\Engine\Source\Editor\Kismet\Private\SCSEditorViewportClient.cpp:260]
UnrealEditor_UnrealEd!UEditorEngine::Tick() [...\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:2111]
UnrealEditor_UnrealEd!UUnrealEdEngine::Tick() [...\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:550]
UnrealEditor!FEngineLoop::Tick() [...\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5921]
UnrealEditor!GuardedMain() [...\Engine\Source\Runtime\Launch\Private\Launch.cpp:180]
UnrealEditor!GuardedMainWrapper() [...\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:118]
UnrealEditor!LaunchWindowsStartup() [...\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:258]
UnrealEditor!WinMain() [...\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:298]
UnrealEditor!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-227939 in the post.

0
Login to Vote

Fixed
ComponentUE - Niagara
Affects Versions5.4.4
Target Fix5.6
Fix Commit37231359
CreatedOct 17, 2024
ResolvedOct 17, 2024
UpdatedOct 18, 2024
View Jira Issue