P2P multiplayer having a hard time spawning new nodes

Godot Version

4.2.1

Question

I made a multiplayer P2P game and i managed to spawn players and have them in sync
but when i want to spawn bullets for them to shoot, the clients can see the hosts bullets but the host and the clients can’t see other client’s bullets.

i’ve used the MultiplayerSpawner but from my understanding its only syncing the host to the clients.
so is there a way to make it sync the client to the host?

I heard about RPC calls but i’m new to making multiplayer games so i wasn’t able to make it work

A MultiplayerSpawner can only work for the peer that it is authorized to. All nodes default to the server authority. So unless you change the authority, only the host can properly spawn and despawn nodes.

You can go about fixing this one of two ways. Make a MultiplayerSpawner that is authorized to each player, or have each remote peer RPC the host to spawn bullets for them.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.