make particles move

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

I have instanced “Particles2d” in my main scene. I want it to move for example 100px to left, or something like this from the script.(with the local coords deactivated,i want that effect when it moves). Is there a way?(like move_and_slide is used for kinematicbody2d maybe,or to try coding drag&drop for the particles?)

:bust_in_silhouette: Reply From: kidscancode

You move a Particles2D like any other Node2D, by changing its position.

$Particles2D.position.x += 100

i want the animation for moving, not to just move

Sakura37 | 2020-01-07 15:05

So move a little bit each frame:

func _process(delta):
    $Particles2D.position += 100 * delta

Or use a Tween or an AnimationPlayer.

kidscancode | 2020-01-07 16:41