Can shuriken Particles be affected by LateUpdate animation?

I have a fire-breathing monster whose head transform is being set in LateUpdate (courtesy of FinalIK’s AimIK and LookAtIK functions). I’m currently using shuriken particle emitters, childed to the head joint, to create a flamethrower effect. However the particle systems emit their particles before LateUpdate, meaning that they don’t take FinalIK’s procedural animation into account.

If I set emission to Local space, the problem is barely noticeable, as the flames only lag one frame behind the slow-moving head, but if I set it to World, the emitters ignore the procedural head transform and send flames out at completely the wrong angle.

Using IK to aim my monster’s attacks is integral to my gameplay, but I want the flame particles to exist in World space so they behave more realistically than the perfectly straight ray that Local space produces. Is there any way to make Shuriken particles take LateUpdate transforms into account, or should I start looking at alternate particle systems?

Hey,

Let’s say you wanted to have a ParticleSystem that emits steam from one of the character’s ears.
Set up the ParticleSystem to the position of the ear, but don’t parent it to the head. Make an empty gameobject instead, name it “Target” and put it to the exact same position and rotation and parent the Target to the head instead. Then add this script to the ParticleSystem gameobject:

public Transform target; // The Transform parented to one of the character's bones

private Vector3 targetPosition;
private Quaternion targetRotation;

void Start() {
    LateUpdate();
}

// Move this ParticleSystem to the target's last frame position before it emits
void Update() {
    transform.position = targetPosition;
    transform.rotation = targetRotation;

}

// Read the world space position and rotation of the target after procedural effects have been applied
// NB! Make sure this script is set to a higher value than FinalIK components in the Script Execution Order!
void LateUpdate() {
    targetPosition = target.position;
    targetRotation = target.rotation;
}

NB! Make sure this script is set to a higher value than FinalIK components in the Script Execution Order!

Cheers,
Pärtel

The world vs local space simulation is only used for moving and rotating the particles. The particles do exist in, and interact with, the world regardless which of these simulation options you use.

Using world simulation, then the particle uses the global coordinate system (i.e. y-axis is always up).
Using local simulation, then the particle uses the local coordinate system, which can differ depending on the object/parent object (i.e. the y-axis doesn’t always have to point up as with the world space).