Need help understanding MultiplayerSpawner

Godot Version

4.5.1

Question

Hi I try to understand and use MultiplayerSpawner for my prototype.

premise: coop fps 3d, I try to spawn enemy dynamically in game from either host or peer.

I managed to do so only with @rpc calls but i tried using MultiplayerSpawner but that failed.

what I tried:

EnemyMGR has code that is activated by signal from interaction with area in game:

in this situation I was able to spawn enemies only when interacted from host, enemy spawned correctly and was synchronized through MultiplayerSynchronizer. If peer tried to interact, nothing happened (I was not surprised here :wink: ).

Without checking for Authority I was able again to spawn from host, and enemy was synchronized.

When Peer tried to interact, enemy spawned only for his own copy, not on host.

I tried to add rpc both with and without authority check and funny thing started to happen.

as it is above, the same situation happened like with previous code with authority check but it errored on add_child(larva, true) it had problem with “true” and adding individual name to an enemy but worked fine in game. If I added_child without “true” then it worked but enemies weren’t synchronized. Without checking for authority more errors happened but not much success.

WORKING VERSION

so in the end I got rid of MultiplayerSpanwe and just did the same with rpc calls and it works fine from all peers/host.

But I don’t understand why MultiplayerSpawner doesn’t work?

How should it be configured?

From tutorial I tried online version 1) should work fine (?)

please help :slight_smile: