Quick answer: Unreal SpawnEmitterAttached firing after the parent component is destroyed? The spawn call captures the component reference - validate before spawn.
Death VFX spawn attached to a dying enemy. Sometimes attaches to a destroyed enemy; particles spawn at origin.
Validate before spawn
if (IsValid(Component)) {
UNiagaraFunctionLibrary::SpawnSystemAttached(...);
}IsValid guards against destruction; spawn only on valid targets.
Or spawn at world position
Capture component's world transform; spawn unattached at that position. Decouples VFX from the dying actor's lifetime.
Schedule for the next tick
If death and VFX spawn happen same-frame, defer the VFX. Cleaner ordering.
“Attached spawn needs a valid attach point. Destruction races are common.”
Build a 'SafeSpawnVFX' wrapper. Captures position pre-destroy; spawns unattached. One pattern; no race.