Why is client not spawning?

inside game mode:

Get Player Start:

Spawn Player:

Works fine for the host, but the client is spawning in like this:

Check if you have the player start point available for client in the level

Hi, the GameMode only exists on the server.

That means, what you’re currently doing is spawning only one single character, the one for the server.

But even if your code would also work for the client, it seems to me then you just have reimplemented the default behavior, which then seems to me that you don’t need all the code in the first place :slight_smile:

What is the end result you are trying to get?

1 Like

I put all the logic inside of the Pawn BP, I want it to spawn the pawn at a random place in the world. Everything works on the host, on the client the character spawns but I can’t possess it.
This is what I have so far:

You may need to call the spawn actor from class in the game mode from the player controller.

Inside the player controller make a variable for your pawn such as “PawnToPossess”. Inside the game mode set that pawn variable by Passing through the player controller as a parameter object reference into the custom event that is in the game mode that is spawning the actor. plug the spawned actor return value into the “PawnToPossess” variable and feed the player controller into the object reference. Then inside the player controller, get that “PawnToPossess” variable and plug that into a possess node and posess the pawn.

You can call this from the character BP, but you need to have a reliable player controller reference to get it to call the correct player controller to call the game mode to spawn the actor so that the player controller can possess the pawn lol.

1 Like

The engine handles all this for you out of the box.
You can override engine functions to alter default behavior.
In this case you probably want to override the function “Find Player Start” in game mode class. simply return a random player start there. The engine will call your function whenever it needs to find a start point for a player to spawn.

To force-spawn a player, call “Restart Player” in the game mode.

1 Like

Here’s my solution:


ThirdPersonCharacter = BP_Naytiri (Pawn)

Widget (Respawn button)

Thanks everyone!