Godot Version
4.3
Question
Hi, I’m using tween inside a loop to animate multi-node. I want to start all node animations at the same time, but the problem is that after finishing all animation for the first node, the second node starts. If I use set_parallel()
, all animation starts at the same time. So, how do I fix that?
extends Node2D
@onready var icon: Sprite2D = $Icon
@onready var icon_2: Sprite2D = $Icon2
func _ready() -> void:
var t = create_tween()
for node in [icon, icon_2]:
t.tween_property(node, "position", Vector2.ZERO, 1)
t.tween_property(node, "position", Vector2(500, 500), 1)
I want to first run t.tween_property(node, "position", Vector2.ZERO, 1)
for both node then t.tween_property(node, "position", Vector2(500, 500), 1)
should I use a loop for each animation?
for node in [icon, icon_2]:
t.tween_property(node, "position", Vector2.ZERO, 1)
for node in [icon, icon_2]:
t.tween_property(node, "position", Vector2(500, 500), 1)