1/25/2024 0 Comments Godot change sceneWhen we're going into the battle I use scene_switcher.change_scene("res://battlescene. If _params != null and _params.has(name): ![]() Get_tree().get_root().add_child(global_data.previous_scene) Global_data.previous_scene = get_tree().get_current_scene()įunc return_to_previous_scene(params = null): So if your new to godot this would be the perfect tutorial for you. # global_data is another singleton I use for storing state and other global data This is a Godot Tutorial on the SIMPLEST WAY to Change Scenes in Godot. Remove SceneTree.changescene () in favor of changesceneto () 38209 4.0 milestone on KoBeWi added this to the 4. I currently have a scene switching singleton called scene_switcher with the current setup extends Nodeįunc change_scene(next_scene, params = null): Once the battle scene is completed I want to return to the previous scene we were at with everything exactly the same. The second way to change scene is through the change scene to method. Currently the battle is a separate scene and when a player walks up to an NPC we have a little transition and then leave the scene and we go to the battle scene.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |