Pawn doesnt spawn to client multiplayer

Hello everybody.

I am making a multiplayer game and i have the next problem. When I execute two instances, the server instance creates the pawn and I can control it, but when is the turn of the client, the server doesnt spawn a pawn and I cant play with the client, I only can use an spectator pawn in the client.

Here a bit of screenshots:

Event OnPostLogin:

Event ClientPostLogin

Event SpawnPlayer

Anyone knows why I cant spawn and play with the client? I execute all in the editor on a new windows with two instances. I changed the Engine.ini for the multiplayer and all is on LAN.

Thanks for your time

Using “GetGameMode” client-side won’t work since GameMode only exist server-side so afaik SpawnPlayer would never be called from the Client to the Server.
You need to make a “RunOnServer” event in the PlayerController where you make the switch from client-side to server-side and then call the SpawnPlayer function in GameMode.

The ClientPostLogin event you have is set to “Executs on Owning Client” so from there on you know you are client-side. Make a new custom event that is “Run On Server” and call it here (client-side). Now you are server-side and can use GameMode to call your server functions.

I am afraid that I dont understand you. I Understand the gamemode idea in the client side, but i dont know how can I make the switch.

With Run On Server you means in the Replicates field, dont you? And this new custom event I need to create on client-side in the player controller or in another place?

At the end changes the ClientPostLogin to Run on server instead of Owning Cliente and it works!

Thanks for your help and I opened another thread with another problem if you want to check it :wink:

Yes the event has to be set to Replicates “Run on Server” on the playercontroller to continue what you are doing.