Add change_scene_to_node() method #9250
Closed
sky94520
started this conversation in
Engine Core
Replies: 4 comments 9 replies
-
Are you adding the node to the scene on the thread as well? That's not supported, you also can't load the same file in multiple threads |
Beta Was this translation helpful? Give feedback.
1 reply
-
To be pedantic, I believe yes? get_tree().current_node.free()
get_tree().current_node = new_node |
Beta Was this translation helpful? Give feedback.
0 replies
-
func change_scene_to_node(node: Node) -> void:
await get_tree().process_frame
get_tree().current_scene.free()
get_tree().root.add_child(node)
get_tree().current_scene = node |
Beta Was this translation helpful? Give feedback.
8 replies
-
Moving to discussion, as there is no concrete technical implementation provided. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the project you are working on
A 2D survivor game at mobile platform using c#
Describe the problem or limitation you are having in your project
Godot has change_scene_to_file and change_scene_to_packed methods, change_scene_to_packed. Whyt not add method change_scene_to_node(const Ref &p_node).
Now I use sub thread load and instance scene, and add_child, set_current_scene. but the replacement is raised error at Android Platform which too many
I guess the godot source code has another logic while change scene.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
I can use the new method to change_scene
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
No
If this enhancement will not be used often, can it be worked around with a few lines of script?
No
Is there a reason why this should be core and not an add-on in the asset library?
No
Beta Was this translation helpful? Give feedback.
All reactions