-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Node not found: MultiplayerSynchronizer" when node doesn't exist on all clients #76894
Comments
cc @Faless |
I'm experiencing the same issue when attempting to delete or remove a node (which contains a MultiSync with local as authority, spawned in on local via MultiSpawner) on the server side, with one error message per node deleted. The error messages do not occur on clients connected to the server. |
Experiencing a similar issue. Any progress on this? |
For nodes that gets dynamically added/removed from tree, you want to use a You can use the visibility API ( |
Got the same problem here. I think I set up everything correctly:
Getting the same get_node: Node not found [...]Player/1/MultiplayerSynchronizer error. After some debugging I found out what happens in my project: The host correctly gets spawned in (Player 1) on his side. Am I doing something wrong here? I think I followed the tutorial and setup correctly... |
What you are all likely missing is configuring your MultiplayerSpawner's Auto Spawn List to include your player scene, so that when a client joins, the host's player scene is spawned automatically and its MultiplayerSynchronizer node is in your node tree. |
I'm having the same problem, but I'm using RPC calls to spawn a node in both client and server. Idk if it's relevant but I'm adding a scene into MultiplayerSpawner and instantiating an inherithed scene |
Maybe it's not the ideal place to ask, but that article is adding the authority in getset. This seems to be forbidden in latest dev5. The tutorial adds auth like this:
I tried to do the same in c#
I set clientId just before adding it in the tree, and this is what I get in console.
Shall I create a github issue for this?
Not in my case. The spawner is populated with the player scene. My strategy is:
Both map and player are inside the Multiplayerspawner The server:
The client:
This is the remote window from client: And this is remote tree from server: It gets fixed if you disable the "Public Visibility" of the NetworkSynchroniser located inside each player, which will make the props not to sync. My guess is that is accurate that the "Map" is not loaded when the sync starts. So I might need to set Public visibility to off and find a way to tell players that only the players inside that map should be able to sync variables (if I understand it correctly) I will try to set the visibility manually only when the scene is completely loaded as this comment recommends and see if that helps |
After tinkering a little bit I arrived into the following rule of thumb:
This apparently works well! But I guess for more performative and non prototype projects you should use low level network But this looks much more like a Server-Client model than a P2P where every player is responsible for its own scenes... Maybe I'm still missing something But my rule solves this issue problem Basically you want something similar to this: @rpc("any_peer", "call_local", "reliable")
func add_node(nodePath: String):
if not multiplayer.is_server():
return
# Always send the nodePath
var newNode = load(nodePath).instantiate()
# Here is the MultiplayerSpawner Spawn Path
# Don't forget this "true" in add child
get_node("/root/Game/Level").add_child(newNode, true)
@rpc("any_peer", "call_local", "reliable")
func remove_node(nodePath: String):
if not multiplayer.is_server():
return
# Here you MUST receive a node path!
var e = get_node(nodePath)
if e:
e.queue_free() When calling from server or client you can use remove_node.rpc("res://your_node")
add_node.rpc("res://your_node")
# or
remove_node.rpc(yourNode.get_path())
add_node.rpc(yourNode.get_path()) |
Just as another note in case someone ends up here, the issue I ran into to cause something like this was accidentally calling |
Either if I use RPCs or a predefined spawner, and am not missing the parent node, I can confirm this error. Adding a multiplayer synchronizer to dynamically spawned objects will cause this error on despawn. Everything works as intended, but why this error set is shown in client in each despawn? Something is really of here, and I feel that there is some unexpected thing happening. |
I had the same issue while trying to fiddle around the project mentionned in the above comments (https://github.com/godotengine/tps-demo) Succinctly, I tried to split the UI node from the
Running it however throws the following set of errors: This error do not happen if I do not use the |
There is a comprehensive way to do it? I never found a correct way of using godot multiplayer |
@olivatooo There is a comprehensive guide on how to spawn level and players here: https://godotengine.org/article/multiplayer-in-godot-4-0-scene-replication/ @banane42 I can't really tell what's happening, make sure you are not removing the level yourself, or try to make an MRP and open a new issue. |
This comment was marked as duplicate.
This comment was marked as duplicate.
I ran into the original issue, where a spawned player's MultiplayerSynchronizer was not found when other clients connected. My setup, really for experimenting, was to build a dedicated server, have the server auto-spawn a dummy player, so when clients join they can see them. However, I was adding the player object (to be spawned) during the server's Maybe there is a bug as this is a slightly different use case, but it's likely something that's expected to be there, some node, isn't. |
I have the same issue, but the only twist is that it works where I am on the same computer, like running multiple instances of the game on the same machine. But when I open the game on two or more computers, the server computer will run into this issue. I don't know what happen at this point. |
Godot version
4.0.2
System information
Windows 10
Issue description
For nodes with a MultiplayerSynchronizer child:
Originally I had planned to only instance scenes on a client if they were in the same "area" but maybe I am barking up the wrong tree~? >0<
Steps to reproduce
OR
OR
Minimal reproduction project
Note: GUI script has a bool/toggle for deleting a node with a MultiSyncy on it after joining
Multiplayer_Test.zip
The text was updated successfully, but these errors were encountered: