Shader compilation and Niagara deactivate issue

Hi! We’ve encountered an issue with Niagara particle systems’ Deactivate functionality when shaders for it are not yet compiled. Basically before they are Deactivate does nothing for the system. bAwaitingActivationDueToNotReady will be true and as soon as ready it’ll start and will stay stuck that way. For example in case of UAnimNotifyState_TimedNiagaraEffect created ones.

We found solution but wanted to validate with you on that.

In UNiagaraComponent::DeactivateInternal, in else branch of “if (IsActive() && SystemInstanceController)” if statement:

if(UNiagaraSystem* NiagaraSystem = Asset.Get())

{

if (bAwaitingActivationDueToNotReady || !IsWorldReadyToRun())

{

Super::Deactivate();

bAwaitingActivationDueToNotReady = false;

OnSystemComplete(true);

return;

}

}

Thank you

Steps to Reproduce
Ina test level create state Niagara particle system and call delayed Deactivate (0.1s) on it.

Create packaged build

Run it with -clearPSODriverCache

Observe particle system is not deactivated.

Hey Taras,

thanks for the report, I’ll create a ticket so this can get fixed for 5.7.

Regards,

Michael