Flipping particles?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By beelzy
:warning: Old Version Published before Godot 3 was released.

I am trying to do this cool trailing effect that some games have where duplicate image of the sprite follow your character when they move. I thought I would try this with the particles effect, but it doesn’t exactly work.

If you turn off local space, the trails appear when you move the character around, but then you can’t flip the sprite when the character changes direction.
If you turn it off, the trails disappear.

I’ve tried changing the scale on the sprite itself and enabling/disabling flip H. It doesn’t work.

Is there a way to flip the sprite with local space turned off?
I wanted to avoid making duplicate mirrored sprites as well to save on space.

:bust_in_silhouette: Reply From: Julian Murgia

Are you trying to do this kind of thing ? https://www.youtube.com/watch?v=2eNo6Y_uGAw&feature=youtu.be&t=385

Ja, something like that. But maybe with slightly longer trails.

beelzy | 2016-02-22 11:42

Please post such questions as comments on the OP, not answers :wink: Though maybe the feature was not enabled yet when you answer yesterday :slight_smile:

Akien | 2016-02-23 18:32

:bust_in_silhouette: Reply From: rgrams

Hmm, there seems to be a bug here. At least for me, the “Flip H” and “Flip V” settings do nothing in either local or global space. Do those work for you with local space on?

But, unless that gets fixed, I think by far the easiest way to do this is to duplicate the sprites. Either use separate files and change the texture, or put them in a sprite sheet and change the “Anim Initial Pos”.

Another option (I think this would work, though I didn’t try it) is to keep the particle system in local space so it flips with the character, and write a script to set the particle direction and velocity to the opposite of the character’s movement. (remember to take into account the flipped scale.)

Or you could not use a particle system at all. Create sprite nodes for as many “Ghost images” as you want and write a script to set their offsets based on the character’s movement.

Yes, flipping with flip H or changing scale works with local space turned on. Unfortunately, it has no idea where the character has been (because it’s in local space), so the trails don’t appear.
I think I will give the local space option a try and hope in the meantime that the bug gets fixed.

beelzy | 2016-02-22 13:50

:bust_in_silhouette: Reply From: michaelscott113

Nice question, there are a lot of useful info in answers, thank you