You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on a project where I wanted to sync an Array of Vector2i for setting up a tilemap, I discovered typed arrays don't seem to play nice with MultiplayerSynchronizer, neither Spawn or Sync mode. In particular, I am testing when a scene with a child synchronizer (syncing the exported array) is replicated by a MultiplayerSpawner. The workaround I found there was to use an Array instead of Array[Vector2i].
Another issue in this same reproduction project is that the automatically generated names for instanced scenes can cause path errors and prevent the scene from replicating to clients. I think this is related to #68508, maybe a configuration issue but I am running into this in my other project as well. If its not a config issue & different enough I can create a separate issue to capture it.
Steps to reproduce
Run 2 instances of the project
Click Host on one
Click Connect on the other
Click "Spawn Test Label" on host, which will instantiate a simple label scene
Note that it fails to correctly create the scene on clients when the 'array' property of spawn_label.gd is a typed array, but works fine when typed as a standard Array
Bonus issue:
5. Comment control.gd:43
6. Try steps 1-4 above and see error generated in console related to get_node
I have the same problem. I have an Array that refused to synchronize with MultiplayerSynchronizer, and I know I had it working earlier. Thought I was going insane. After reading your issue I tried changing its type from Array[int] to Array. And then it worked perfectly.
At some point I added static typing to all my variables to make my code less error prone, and that apparently broke the synchronizer. Ironic. :)
Godot version
4.0 stable
System information
Windows 10, NVidia RTX 3080, Vulkan
Issue description
While working on a project where I wanted to sync an Array of Vector2i for setting up a tilemap, I discovered typed arrays don't seem to play nice with MultiplayerSynchronizer, neither Spawn or Sync mode. In particular, I am testing when a scene with a child synchronizer (syncing the exported array) is replicated by a MultiplayerSpawner. The workaround I found there was to use an Array instead of Array[Vector2i].
Another issue in this same reproduction project is that the automatically generated names for instanced scenes can cause path errors and prevent the scene from replicating to clients. I think this is related to #68508, maybe a configuration issue but I am running into this in my other project as well. If its not a config issue & different enough I can create a separate issue to capture it.
Steps to reproduce
Note that it fails to correctly create the scene on clients when the 'array' property of spawn_label.gd is a typed array, but works fine when typed as a standard Array
Bonus issue:
5. Comment control.gd:43
6. Try steps 1-4 above and see error generated in console related to get_node
Minimal reproduction project
SyncTypedArray.zip
The text was updated successfully, but these errors were encountered: