Hello, I am tying to create a small multiplayer scene where I have players firing projectiles but I am having some problems.
Currently I have setup a MultiplayerSpawner node which has a player scene as well as a projectile scene added to its auto spawn list. Both the player scene and projectile scene have a MultiplayerSynchronizer node which synchronizes the position and rotation.
I have successfully gotten two players into the scene on both clients, including movement and rotation.
My issue is that whenever I try to create the projectiles, when the host fires a projectile it is also replicated on the client but when the client fires a projectile it is not replicated on the host. I assume this is related to the following:
"Auto Spawn List: Defines the scenes to be automatically replicated when added as a child of spawn_path by the authority (server by default)."
found at: https://godotengine.org/article/multiplayer-in-godot-4-0-scene-replication/#spawning-and-despawning-scenes
Since only only the scenes added by the host (server) would be replicated by default.
The post also says:
"You can use the set_multiplayer_authority() method to control which peer is allowed to instantiate scenes via the spawner (the server by default)."
but I don't see how this could solve my issue since giving the authority to the client instead of the host would from what I understand just cause the same issue in reverse, that the client could spawn scenes on both the client and the host but the host would then only be able to spawn scenes on the host.
Is there a way to allow all peers to have authority to instantiate scenes?
I understand that allowing all peers to have authority might be a problem if the clients can't be trusted but that's not a issue to worry about in my case. However if there are any resources or if anyone could help out to explain how it's done, I would be glad to hear.