0 votes

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 moveandslide is used for kinematicbody2d maybe,or to try coding drag&drop for the particles?)

in Engine by (92 points)

1 Answer

0 votes

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

$Particles2D.position.x += 100
by (20,479 points)

i want the animation for moving, not to just move

So move a little bit each frame:

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

Or use a Tween or an AnimationPlayer.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.