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!

asked Dec 14, 2017 in Engine by AlighaThor (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()
answered Dec 14, 2017 by Skyfrit (406 points)
selected Dec 14, 2017 by AlighaThor

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.