Godot Version
4.3
Question
`I want to loop 2x then delete the object after loop 2x. in my script the object is deleted after the first loop. how to fix this. this is my script. thanks
extends Control
@onready var _texture_rect = $BG/TextureRect
func _on_button_pressed():
var tween = get_tree().create_tween().set_loops(2)
tween.parallel().tween_property(_texture_rect, “position”, Vector2(get_viewport_rect().size.x - 128, 476), 1.0)
tween.parallel().tween_property(_texture_rect, “scale”, Vector2(2, 2), 1)
tween.tween_interval(1)
tween.tween_property(_texture_rect, “position”, Vector2(0, 476), 1.0)
tween.parallel().tween_property(_texture_rect, “scale”, Vector2(1, 1), 1)
tween.tween_callback(_texture_rect.queue_free)`