tween I need help

Godot Version

v 4.6.1

the seconed tween is not running when the first ended what shall I do

heres the code

extends Node2D
@onready var mark: Node2D = $Node2D/mark
func _process(_delta: float) → void:
var t=create_tween()
t.tween_property(mark,“global_position:y”,-10,0.5)
t.tween_property(mark,“global_position:y”,10,0.5)

You put this in the _process() function, which runs every frame, therefore your Tween is created and restarted every frame. The effect of that is that you don’t see anything happening, because you keep creating new tweens before the last one had any time to do anything.

There are many ways to fix it, but you should first explain what are you trying to achieve with this tween?

2 Likes