Closed clorl closed 3 years ago
In your test project the "Server" autoload node gets deleted in start_as_server()
because of get_tree().root.get_child(0).queue_free()
.
Autoload Nodes are added to the SceneTree on game start before all other scenes and nodes and therefore get_child(0)
returns the autoload "Server" node at game start and not the other nodes that I think you want to queue_free()
. The reason why it can finish the create_server()
before printing an error is because queue_free()
deletes the server node not immediately but with a delay and the RemoteSceneTree is very slow to show the update visually.
Closing as it's a project bug, not Godot's.
Godot version: 3.2.3
OS/device including version: Windows 10 Home Edition 1909 / KDE Neon 5.20
Issue description: While playing around with multiplayer, I created an autoload Server.gd as well as Client.gd. After starting the project as server, the
create_server
function is called on Server.gd which creates the network server. But after that, the Server node disappears from the scene tree.I believe this is because after the server is created, no more functions or scripts are called. Server.gd just waits for RPC calls, so on its own instance, Godot thinks that the Server node is no more needed, and then just deletes it. I have tried reproducing the bug in a brand new project without success
Here is a demonstration of the live behaviour
Steps to reproduce: I don't know
Minimal reproduction project: http://github.com/clement-or/space-game