How do I keep particles from following the parent?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By epark009

I have a sprite and a Particle2D. I would like to prevent the particles emitted by the Particle2D node from following the parent. That way, it’ll create this trailing effect when the sprite moves around. Is there a way to achieve this?

:bust_in_silhouette: Reply From: wowzzers

Try detaching the particle from the parent and attaching it to the main scene. Something like this:

var root = get_tree().root
var main_scene = root.get_child(root.get_child_count() - 1)
get_parent().remove_child(self)
main_scene.add_child(self)
self.set_owner(main_scene)

self in this case is a particle node.

:bust_in_silhouette: Reply From: EnderCreeper1st

Yes, on the Particles2D inspector go under the Drawing and uncheck Local Coords, this will prevent the Particles from following the local coordinates of the Parent, and start emmiting as a Global Coordinates.

Hope it makes sense…