Fade Out
Part of the Game Feel section of Coddy's Godot journey. Lesson 3 of 23.
modulate is a Color with four parts: red, green, blue and alpha (a). Alpha is how solid the node looks. 1 is solid and 0 is invisible.
To tween one part of a property, write the part after a colon:
var tween = create_tween()
tween.tween_property(self, "modulate:a", 0.0, 1.0)"modulate:a" is a single number, so the end value is 0.0. Red, green and blue stay the same. This also works for "position:x" and "scale:y".
A fade is not the same as visible = false. The node stays visible but becomes fully see-through.
Challenge
EasyMake the robot fade away: tween "modulate:a" to 0.0 over 1 second.
Try it yourself
extends Node2D
func _ready():
pass
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Game Feel
Practice on your own: Godot playground