Godot - Implement move animation with Tween
Code example to implement move animation using Tween in GDScript.
Move animation can be implemented using Tween.
Create a new Tween with create_tween()
, and create a "position" change animation with tween_property()
.
Create the Tween on the node you want to animate.
# tween_property(target node, "position", Vector2(X, Y), duration)
# Move Animation
var tween = create_tween()
tween.tween_property(self, "position", Vector2(100, 100), 1.0)
tween.play()