+1 vote

Hi everyone,

I wanna interpolate the opacity of an AnimatedSprite using a Tween node in Godot 3.0, but there's no opacity property in the inspector, since I tried

"visibility/opacity"

which worked fine in 2.1, but has no effect here.
Does that mean they haven't implemented it yet or am I using the wrong property string?

in Engine by (570 points)

1 Answer

+5 votes
Best answer

In 3.0, the property is modulate, which combines color and transparency.

To tween the property, since the value is a Color, you have to give two colors as an argument. So to just fade the sprite you'd do this:

$Tween.interpolate_property($AnimatedSprite, "modulate", 
    Color(1, 1, 1, 1), Color(1, 1, 1, 0), 2.0, 
    Tween.TRANS_LINEAR, Tween.EASE_IN)
by (21,967 points)
selected by

Thanks, it works!
I actually got there, but I kept using Color(255, 255, 255, 0) because I got confused with CSS :p
BTW I love your videos, keep up the good work!

`

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 Frequently asked questions and 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 [email protected] with your username.