+1 vote

I've got a tween setup with the following on a sprite:

tween.interpolate_property(sprite, "visibility/opacity", 1.0, 0.0, 0.3, Tween.TRANS_QUAD, Tween.EASE_OUT)
tween.interpolate_property(sprite, "scale", sprite.get_scale(), Vector2(1.7, 1.7), 0.3, Tween.TRANS_QUAD, Tween.EASE_OUT)

The scale works fine, but not the transparency. What's the equivalent in V3.0?

in Engine by (237 points)

2 Answers

+5 votes
Best answer

You can use "modulate:a" to change the opacity.

tween.interpolate_property(sprite, "modulate:a", 1.0, 0.0, 0.3, Tween.TRANS_QUAD, Tween.EASE_OUT)
by (594 points)
selected by
0 votes

From what I gather, it's under CanvasItem/Modulate - you have Alpha value there.

by (33 points)

I tried "CanvasItem/Modulate" but that had no effect. So I tried "CanvasItem/Modulate/Alpha". That didn't work either. So to use tween to adjust alpha, how does it work?

I selected the answer "modulate:a" as that worked.

imekon, ah, sorry, I misinterpreted the question, my bad, I thought you were asking about Editor properties.

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.