Question by
Happystudio · Mar 14, 2019 at 05:56 AM ·
trailrenderer
Trail renderer continues when emitting is false
I have a trail renderer on a 3d object, when i use script to turn emit off and then move the object, the trail will still continue for that movement.
I am using this code to switch it off:
trail.emitting = false;
transform.position = pos;
e.g. starting at point A i switch off the emitter, move to point B and then on to point C. the trail will continue from A to B but not on to C.
Comment
Answer by efge · Apr 30, 2020 at 09:16 AM
You have to wait one frame after disabling and before enabling:
trailRenderer.emitting = false;
yield return new WaitForEndOfFrame();
transform.position = pos;
yield return new WaitForEndOfFrame();
trailRenderer.emitting = true;
Your answer