Make MultiplayerSpawner wait until the new client has loaded the map?

Godot Version

4.6.2

Question

I’m trying to add the ability to join mid-match to the multiplayer first-person shooter I’m working on.

The main issue I’m facing right now, from what I can tell, is that the MultiplayerSpawner that takes care of spawning all the players at the beginning of the match (after the host has clicked “Start” in the lobby) automatically (and reasonably) tries to synchronize the players already in the match with the newly connected one, but since this happens right when the player connects, it won’t have fully loaded the map yet and as such it can’t add the player nodes to it. And if I set it to add them as children of the spawner itself, it can’t load the spawn position since that’s stored on the map.

Is there any way to make a MultiplayerSpawner “wait” until a certain condition is met? Or am I going about this the wrong way?

How come you cannot pass that information?

Because that information is stored on the map, which at that point is not yet loaded

Every node has a ready signal. You could just wait for the map’s ready signal before loading that data.

I tried that already, but I can’t figure out how to get the MultiplayerSpawner node to wait, it just synchronizes automatically as soon as the peers connect

Then don’t spawn it in the map until the map is loaded.

1 Like

Don’t spawn the MultiplayerSpawner?

Hmm… neat proposal actually, I’ll get back to you on if it fixes the issue

1 Like