Changing sprite alpha using tween not working as expected

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

Hey all - I’m trying to fade in sprites using tween functionality, as the question says. I’ve tried various methods, but none of them are working. In the attached script, a sprite (with a tween node attached) SHOULD fade in as soon as the game starts, but that doesn’t happen.

I’m pretty new to Godot, so my guess is that I’ve made a simple mistake somewhere along the line. Or several.

extends Sprite


# Called when the node enters the scene tree for the first time.
func _ready():
	print("this function is running")
	$Tween.interpolate_property(self, "modulate", 
      Color(1, 1, 1, 0), Color(1, 1, 1, 1), 2.0, 
      Tween.TRANS_LINEAR, Tween.EASE_IN)
:bust_in_silhouette: Reply From: kidscancode

The Tween isn’t running. You need to call start() on a Tween once you’ve set its interpolation. Add

$Tween.start()

after the interpolate_property() line.