0 votes

Hi everyone,

I'd like to know what "gettree().reloadcurrent_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 gettree().reloadcurrent_scene() doesn't work.

What am I doing wrong? Any suggestions?

EDIT:
Meanwhile I understand that "gettree().reloadcurrent_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?

in Engine by (317 points)
edited by

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.