0 votes

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)
asked Nov 19, 2019 in Engine by ElizabethBallou (12 points)

1 Answer

0 votes

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


after the interpolate_property() line.

answered Nov 19, 2019 by kidscancode (13,074 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.