Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | pferft |
Hi everyone,
I’d like to know what “get_tree().reload_current_scene()” actually does.
I have the impression that what it is not doing is “resetting” a scene in the way of “interrupting”, meaning canceling everything following in the script and directly jumping to the beginning. But this is what I would like to achieve.
For example: I have an animated button, zooming small when tapped and popping back to big when released. I attached a timer to the button so when I hold it down for a second it will trigger an animation of slowly zooming back to big… at this point I would not want the release to be triggered anymore, so I thought “resetting” to the beginning of the scene at slowly-zooming-back could do the trick, but I just can’t figure out how to cancel the input of the held-down button at this point. Obviously get_tree().reload_current_scene() doesn’t work.
What am I doing wrong? Any suggestions?
EDIT:
Meanwhile I understand that “get_tree().reload_current_scene()” gets right back to the “root” of all things, reloading the entire “main” scene.
So the question shifts more to: How can I reset the state of a part of the tree from any point within that part?