How to use key in on_tween_completed signal

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

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 on_tween_completed 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")
:bust_in_silhouette: Reply From: Cellist1972

The correct code is:

if key == ":rotation_degrees":

I missed “:”