Synching instantiated objects between clients

Godot Version



Im developing a P2P Multiplayer game and i need to synch objects between players.

My setup is: The host has an InventoryManager that keeps track of every object that is either in a players Inventory or loosely on the ground as rigidbody. When a player picks up an object said InventoryManager will update its dictionaries. I don’t think it is necessary for the players to have an inventoryManager that is synched to the one from the host.

So if a player now drops an item, i want to instanciate a rigidbody based on the instance the InventoryManager determines. If i send the path of the scene that needs to be instanciated, the Multiplayer synchronizer doesn’t recognize it as the same object and thus doesn’t snych it properly.

One aproach that works-ish is that i setup a MultiplayerSpawner for the Items Node inside my main scene and then add the item to the autospawner and just instanciate on the host side, but maybe there is a better solution that im unaware of.