0 votes

I have a popup that brings up using the popup function, but I want it to animate it when it comes up with like a fade in or something like that.
I tried to put an animationplayer on it and make it autoplay but it's not working, the only idea I have rn is using a script like this:


But I wanna know if there is anything integrated within the engine that simplifies this method?
Any help is appreciated!

in Engine by (254 points)

1 Answer

0 votes

If you want to make the popup fade in, you can interpolate the alpha value from 0.0 to 1.0.

  1. Add a Tween node to your popup.
  2. Connect the about_to_show() signal to your popup node
  3. In the connected method _on_MyPopUp_about_to_show, add the interpolation to your tween: tween.interpolate_property(self, "modulate:a", 0.0, 1.0, 0.3, Tween.TRANS_LINEAR, Tween.EASE_IN)
  4. Start the interpolation with tween.start()

You can read a bit more about tweens here: https://docs.godotengine.org/en/stable/getting_started/step_by_step/ui_code_a_life_bar.html

by (14 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.