I have a Player scene (which is in the MultiplayerSpawner like BatteryAcidDev have done it in his videos) with some information about the player. On my fist prototype a space ship was attached dirct in the scene and everything worked.
Now on connect I send a rpc call which shows the client a menu to select a space ship. After selecting one the client send the selected ship (internal id) to the server. The server adds the space ship .add_child() to the player scene => The space ship is not syncroniced to all clients. On the host screen it works fine.
Question
How can I get the MultiplayerSpawner to send the dynamicly added child to all peers? I have mutlible SpaceShip_Type scenes which inherit from a SpaceShip_Base class (RigidBody2D)
I added it but didn’t help. (see screenshot, selected the MultiplayerSpawner so you can see the auto spawn list).
Schouldn’t the space ship be visible under my player object as I add dem with force_readable_name?
var ship = ship_1.instantiate()
ship.name = "SpaceShip"
_players_spawn_node.get_node(str(peer_id)).add_child(ship, true)
I think I found a good Solution: I have added a MultiplayerSpawner in the Player scene which have the ships scenes in the auto spawn list.
Is there a limit of MultiplayerSpawner (and MultiplayerSyncronizer) a project can handle? With the above solution there will be a good amount for each player (Bullets will than have also there own spawner).