–2 votes

My nodes are like this
Control
Colour rect (Background)
Button (change scene to the game )
colour rect (to create the fading effect)
animation player (Black to Transparent animation of colour rect)

I want to create a fading effect between the menu screen and the game.
I want to make it like the animation starts when the button on the screen is pressed so it looks like a fading effect.
Please me with this code or is there a better way to do it.
(Explain Briefly and NO LINKS ALLOWED )

in Engine by (38 points)

Explain Briefly and NO LINKS ALLOWED

Hmmm... That seems like a strangely limiting request. Why would you not accept help in any form that someone chooses to provide it?

@jgodfrey Because people come and give links and say that go here and you will know everything and it is always the Godot doc Website which I know already.
If I know that link already then why did I came here to ask for help, there should be a reason for that that someone would explain that briefly to me.

Hi!

I would attach a script to the colour rect, initiate the onButton_pressed() signal from the Button, connect it to the colour rect script and start it's animation with animationplayer from the connected function in the script with code.

Something like this (only illustration):

func _on_Button_pressed():
    $AnimationPlayer.play(...)

Please log in or register to answer this question.

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.