Tween resets when reparent node

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dlsehf1263

I have a Sprite with Tween added.

And when I change the parent of the Sprite, the Tween stops.
Even if it is added to the same parent again, it is reset, so I think there is a process to stop Tween in remove_child or add_child.

If the conditions below are not met, many parts of the code need to be modified.

  1. Tween is a child of Sprite.
  2. You need to change the parent after Tween.start().
var item = Sprite.new()
item.texture = preload("res://sprite.png")
add_child(item)

var t = Tween.new()
item.add_child(t)
t.interpolate_property(item, 'scale', Vector2.ZERO, Vector2.ONE * 5, 1)
t.start()

remove_child(item)
add_child(item)

I searched for a long time but couldn’t find the answer. Help!