![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Cronos87 |
Hello!
I have a menu with buttons and once a button is clicked, I created an helper that attach a node instance to the scene that play a fade in animation.
This is working properly (even if I don’t know if this the most optimised way to do this).
When the animation ends, I change the scene.
My problem is when the animation is playing I would like to prevent to launch the button’s function again. At the moment I’m using:
get_tree().get_root().set_disable_input(true)
but the next scene won’t be able to process inputs, so I enable the input in the ready function. But… I don’t think it’s an elegant way to do this.
Is it safe to enable the inputs right after I call the change_scene() function?
Especially if I press enter a lot of times.
EDIT: My game is designed to be played on keyboard and gamepad only.
I would like to avoid to add issue in my game.
Thank you for your help.