The BP function calls FNiagaraSystemInstance::SetEmitterEnable, which sets ExecutionState on the emitter instance to ENiagaraExecutionState::Inactive. FNiagaraSystemSimulation::PrepareForSystemSimulate then tries to copy the current execution state before running the system update script, but that will never work:
FNiagaraEmitterInstance& EmitterInst = Emitters[EmitterIdx].Get(); if (EmitterExecutionStateAccessors.Num() > EmitterIdx && EmitterExecutionStateAccessors[EmitterIdx].IsValidForWrite()) { EmitterExecutionStateAccessors[EmitterIdx].Set(SystemIndex, (int32)EmitterInst.GetExecutionState()); }
IsValidForWrite() is always false here, because the destination buffers haven't been set up yet. Anyway, even if that worked, we don't want to set the destination value, since it will be overwritten when the update script runs; we want to set the source value, and it's not clear to me how that can be done.
Finally, FNiagaraSystemSimulation::TransferSystemSimResults gets the value that the update script produced and updates the emitter's ExecutionState field with it. The state set from BP is never taken into account.
1. Open the map /Game/Developers/mihneabalta/DeactivateEmitter in the EngineTest project
2. Play in editor
3. Observe that the fountain emitter produces particles, despite the level blueprint trying to deactivate it on each tick using the SetEmitterEnable function
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-89870 in the post.
0 |
Component | UE - Niagara |
---|---|
Affects Versions | 4.25 |
Target Fix | 5.4 |
Fix Commit | 27684825 |
---|---|
Main Commit | 11837658 |
Release Commit | 11586497 |
Created | Mar 2, 2020 |
---|---|
Resolved | Sep 27, 2023 |
Updated | Oct 4, 2023 |