0 votes

Hi, I'm new to GDscript and programming. Recently I was trying to do a text cloud which will slowly disappear. I created a scene which is a label node with a script attached to it.
The scene is spawned above the player whenever he "says" anything. Here goes the script:

 var alpha = 1

 func _process(delta):
        alpha -= 0.001
        print("text")
        set("custom_color/font_color",Color(1,1,1,alpha))

The text and font were set manually. The text isn't changing, but the word "text" is being printed. I tried to use this code with RichTextLabel, but the result is the same. Have I failed to find the right method? Is it possible at all? Do I have to create shaders for this? (I've already suffered a lot please don't make me do this)

in Engine by (15 points)

1 Answer

+1 vote
Best answer

you can achieve by just using .modulate

var alpha = 1.0

func _process(delta):
    modulate.a -= 0.1 * delta
by (9,702 points)
selected by
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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.