Niagara Effect gets stuck

We have the problem that a Niagara Effect gets stuck because a sequence is triggered when the effect is already deactivated but not destroyed.

The sequence jumps to a view target that is far enough away for the effect to be culled.

The camera jumps back to the player at the end of the sequence which disables culling which restarts the effect.

The effect is now stuck.

The effect in our example is triggered from a montage with a timed Niagara effect animation notify state. The effect is started and stopped by the animation notify state.

I could reproduce the same effect by just deactivating a running Niagara effect and triggering re-register by setting view targets. This is shown in the packaged example.

I can solve the problem for our specific case by disabling scalability culling for this particular effect.

I looked a little bit into how to fix the bug in a general matter and atm I was thinking of not re-registering Niagara effects that are set to Inactive either in the “UNiagaraComponent::ResolveOwnerAllowsScalability” or in the “FNiagaraWorldManager::RefreshOwnerAllowsScalability” function.

bool UNiagaraComponent::ResolveOwnerAllowsScalability(bool bRegister)
{
  if (bRegister && SystemInstanceController && (SystemInstanceController->GetActualExecutionState() == ENiagaraExecutionState::Inactive))
  {
    return false;
  }
 ....
}

Did I misunderstood something or is the behavior not what it should be?

Steps to Reproduce
* Have a Niagara Effect set to run indefinitely set to be culled with cull reaction “Asleep”

* Deactivate the effect

* Trigger a re-register by setting the player camera to a view target to a target that is far away

* Reset the view target to the player

* The Niagara effect that was deactivated is now stuck

Reproduction was done in unreal 5.5 we also observe it in 5.6.

Reproducible in the submitted example by pressing ‘E’ while playing. This will deactivate the effect and set view targets which leads to the effect being stuck.

Hi,

I believe your interpretation is correct where it should respect activation state.

I created a bug report for this issue that can be tracked here if/when it’s approved for public visibility: Unreal Engine Issues and Bug Tracker (UE\-346925\). There is no ETA as priorities for bugs and features can shift at any time.

As for your workaround, it may be beneficial to create a flag to mark components that are manually deactivated so as to not add them back. That way any potential edge cases might be avoided.

Please let me know if you have any follow-up questions or comments.

Regards

Thanks for the reply. For now we could disable scalability settings for some selected effects. I will add the flag if we have the problem in more cases.

Sounds good! I’ll be closing this case, but feel free to follow-up with any questions.

Thank you.