I am successfully rotating a node to mouse position by tweening.
After the rotation tween finishes, I want to use a second tween to move the node to mouse position. The ontweencompleted function gets called, "rotation_degrees" gets printed, but not "Rotation ended". Why? What am I missing?
func rotate_tween(target_position: Vector2):
var angle_to_target: float = rad2deg(parent.get_angle_to(target_position))
tween.interpolate_property(
parent,
"rotation_degrees",
parent.rotation_degrees,
parent.rotation_degrees + angle_to_target,
1.0,
Tween.TRANS_LINEAR,
Tween.EASE_IN_OUT)
tween.start()
func _on_tween_completed(object, key):
print(object, key)
if key == "rotation_degrees":
print("Rotation ended")