The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

0 votes

Hi! Here I found how to open popup with animation. But how to do same on closeing? I tried this:

func popup_hide():
    var tween : Tween = get_node("Tween")
    tween.interpolate_property(self, "modulate:a", self.modulate.a, 0.0, 0.3, Tween.TRANS_LINEAR, Tween.EASE_IN)

But it doesn't work for me. It looks like I should to run animation and use popup.hide() only after it. But how to use it for non-exlusive popups? Or are there other way?


Godot version 3.3.2
in Engine by (102 points)

What is your working code to open it?

(Sorry putting this as an answer. Fat fingers.)

Why you put it into answer, not comment?


func _ready():
    connect("about_to_show", self, "_on_about_to_show")

func _on_about_to_show():
    var tw =
    tw.interpolate_property(self, "modulate:a", 0.0, 0.99, 0.2, Tween.TRANS_LINEAR, Tween.EASE_IN)

1 Answer

0 votes

Popups aren't really meant to have a closing animation. I think it would be easier for you to just use a normal panel or something like that to animate it closing.

by (8,550 points)
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.