-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
MultiplayerSynchronizer does not sync properties on scene root #62027
Comments
Did some more investigation, if we change |
It's the starting path to use for referencing properties. |
It also works if you make a standard node the parent of |
This is fixed after #62961 with the following small change to the gdscript code (adding diff --git a/world.gd b/world.gd
index 32e01b3..f481f3d 100644
--- a/world.gd
+++ b/world.gd
@@ -16,7 +16,8 @@ func _enter_tree():
print('server listening on localhost 12100')
multiplayer.set_multiplayer_peer(peer)
- #create_player(multiplayer.get_unique_id())
+ await get_tree().process_frame
+ create_player(multiplayer.get_unique_id())
else:
peer.create_client("localhost", 12100)
multiplayer.set_multiplayer_peer(peer) Spawning on a child during the I'll leave this issue open for now since it has nice keywords for search, but I should probably open a dedicated issue soon. |
One more thing I've noticed while testing is that MPSynchronizer bypasses property setters. Is this expected or a bug? |
That's likely a bug, it's supposed to call setter/getters. |
Godot version
136f84f
System information
Fedora Silverblue 36, Ryzen 2400G
Issue description
MultiplayerSynchronizer does not sync properties if they are located on the root node of a scene. Instead they remain at their initial values. I have tested this with
CharacterBody2D
andCharacterBody3D
nodes, not sure if it would be the same with a simpleNode
at the scene root.Steps to reproduce
Get the reproduction project: https://github.com/jgillich/gotodot-mp-repro (run with at least version 0df0a07, not alpha9)
--use-child
to the run argumentsThere is potentially another bug, if you uncomment the
create_player
line inworld.gd
so the server is also a player, and then try to join with a client, you get a bunch of errors. In the bomber example the server is also a player, but I haven't managed to figure out what the difference is.Minimal reproduction project
https://github.com/jgillich/gotodot-mp-repro
The text was updated successfully, but these errors were encountered: