0 votes

Hi again! I created my first tween and it's not animating at all. :(
I have a texture button inside a CanvasLayer who is a direct child of my Root node, that I'm trying to animate it's opacity when I press it.

Here's my setup:

func _ready():
    set_fixed_process(true)

    start_button = get_node("CanvasLayer/StartButton")
    effect = get_node("Effect")

func _on_TextureButton_pressed():
    effect.interpolate_property(start_button, 'visibility/opacity', 
        1, 0, 0.3, Tween.TRANS_QUAD, Tween.EASE_OUT)

When I press the button nothing happens. It remains with its opacity at 1. Any help?

Have a nice day!

in Engine by (21 points)

1 Answer

+1 vote
Best answer

You need to start the tween node.

effect.interpolate_property(start_button, 'visibility/opacity', 1, 0, 0.3, Tween.TRANS_QUAD, Tween.EASE_OUT)
effect.start()
by (594 points)
selected by

lol. Thanks! ;)

You're welcome.

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.

Categories