According to the documentation, change_scene_to_file deletes the current scene. From the documentation: "We can delete the existing scene. SceneTree.change_scene_to_file() and SceneTree.change_scene_to_packed() will delete the current scene immediately." Source: docs.godotengine.org/en/stable/tutorials/scripting/change_scenes_manually.html Maybe try using .free() as the documentation says.
Whenever I switch back, it stops working. Like, if I'm on scene1, then switch to scene2, then back to scene1, it stops working. I can't go back to scene2. This is the error that I'm getting: emit_signalp: Error calling from signal 'pressed' to callable: 'Button::_on_pressed': Method not found.
@@JumboGamedev How could that be? It's literally the exact same scene I used to switch to another scene. How come the method is not defined this time around?
@@kagenek0 This was the first thing that came to my mind based on the error, but it is hard to know exactly why because I don't have enough information. But my guess is that if you are changing the scenes, there could be something difference in the way you initialize the scene from the first time compared to the second time, because everytime you change the scene, you get a new instance.
Hello I have a question. What's the best way to access a scene multiple times? E.g. if I want from th main menu to go to an options scene back and forth multiple times. Cause the simple change scene functions doesn't work when there is more code there.
If you want to access the same scene multiple times, you can hide the scene, and then show it back when you need it. Or you can remove the scene from the sceneTree, then attach the scene back when you need it.
@@JumboGamedev Thanks for the help dude. I also found another way to deal with it now but I could try those. How you mean tho to hide it or remove it from the scene tree? I mean from which script you do that?
@@thesomeone2nd You are very welcome! You can do that in the script of the main menu. You can have an instance of the options scene in the main menu scene. You can then set the visibility property of the root node of the options scene to false Or you can remove it using remove_child() on the parent node of the options scene.
Wow i love the not too long video + the calming voice that is not speaking at a 300 words per seconds rate + the visuals!!
TYVM!
Thank you very much!
Thank you so much for this, Sensei! 🙏🙏🙏
You are very very welcome 😁👍👍
World class level format and explanations videos for core concepts of Godot. Great great job. Thank you for doing this !
Thank you very much!
you saved me a lot of time. Thank you!
You're welcome!
The old scene is still in memory. I'm trying to figure out how to completely reset the previous scene (I'm using change_scene_to_file).
According to the documentation, change_scene_to_file deletes the current scene.
From the documentation: "We can delete the existing scene. SceneTree.change_scene_to_file() and SceneTree.change_scene_to_packed() will delete the current scene immediately."
Source: docs.godotengine.org/en/stable/tutorials/scripting/change_scenes_manually.html
Maybe try using .free() as the documentation says.
Excellent explanation! Thanks!
Thank you!
Extremely helpful, thanks!
You are very welcome!
Whenever I switch back, it stops working.
Like, if I'm on scene1, then switch to scene2, then back to scene1, it stops working. I can't go back to scene2.
This is the error that I'm getting:
emit_signalp: Error calling from signal 'pressed' to callable: 'Button::_on_pressed': Method not found.
This looks like the method `_on_pressed` is not defined in the script attached to the Button node.
@@JumboGamedev How could that be? It's literally the exact same scene I used to switch to another scene. How come the method is not defined this time around?
@@kagenek0 This was the first thing that came to my mind based on the error, but it is hard to know exactly why because I don't have enough information. But my guess is that if you are changing the scenes, there could be something difference in the way you initialize the scene from the first time compared to the second time, because everytime you change the scene, you get a new instance.
Thanks bro, it helped me a lot 😁
You are very welcome! 😁😁
Perfect
Thank you very much!
Ty onii-sama
Thank you very much!
Thank you, Sir, 🙏🌺😇
You are very welcome, Sir 🙏🌺😇
@@JumboGamedev 🙏🌺😇
Ty onii-chan
You are very welcome 👍
Thanks man
You are welcome!
Nice. What tools do you use for the animation?
he said somewhere it was after effects i think
skibidi sensei would be proud of you
Thanks! I'll keep doing my best to make Skibidi Sensei proud!
im having a problem with this, for me it only works once and then it stops working
Which part?
change scene to file and change scene to packed@@JumboGamedev
Hello I have a question. What's the best way to access a scene multiple times? E.g. if I want from th main menu to go to an options scene back and forth multiple times. Cause the simple change scene functions doesn't work when there is more code there.
If you want to access the same scene multiple times, you can hide the scene, and then show it back when you need it. Or you can remove the scene from the sceneTree, then attach the scene back when you need it.
@@JumboGamedev Thanks for the help dude. I also found another way to deal with it now but I could try those. How you mean tho to hide it or remove it from the scene tree? I mean from which script you do that?
@@thesomeone2nd You are very welcome!
You can do that in the script of the main menu. You can have an instance of the options scene in the main menu scene. You can then set the visibility property of the root node of the options scene to false Or you can remove it using remove_child() on the parent node of the options scene.
@@JumboGamedev alright thank you very much for the explanation have a good day
@@thesomeone2nd You are very welcome. You Too!
i tired to get a path with resource var with c# scipt :BAD IDEA it can courpt ur data so dont try it and use string for now
Thanks for sharing!