Calling 'SetPaused' on a Niagara Component crashes the engine

Steps to Reproduce:

  1. Activate a Niagara Component
  2. Deactivate the Component
  3. Call ‘Set Paused’ on the Component.

Result:

NiagaraSystemSimulation will crash on line 807, with the following check() being triggered:

int32 SystemIndex = Instance->SystemInstanceIndex;
check(SystemInstances.IsValidIndex(SystemIndex));

You always want to check that the component is valid before calling any functions like SetPaused()

This would look like:

    if(MyComponent){
          MyComponent->SetPaused(true);
    }

But I’m pretty certain that deactivating the Niagra component will disable it so you can’t call any functions on it. By this manner, just make sure to call all your functions (like SetPaused) before deactivating.

Yeah it’s guarded already, and I even tried checking if it’s not been deactivated just in case.

It seems strange to block calls to functions to the component if it’s been deactivated. Deactivating cascade components is the right way to stop a cascade system emitting new particles and not having to create a new component each time you want it activated.