Character selection won't work on client

I recreated in a small project my problem.
I have created a spawn menu where a player choose a character and clicking a Join Game button he enters the GameMap (the game level) possessing the selected character.
The problem is that functions only for administrators (servers) and not for players.
The server creates a session (loads the GameMap) and automatically is spawned possessing his new character, but the clients that join the server session do not possess the selected character and are spawned using the default pawn assigned by the Game Mode. When i use the client as a server he logs in with the new character. When i packaged the project and executed twice the game the behavior was the same so the first who created the server could change character and all the other don’t.

The first screenshot contains the creation and search - join session events.

The second screenshot containts the events that trigger the spawn events.

The Spawner BP contains the final Spawn commands after bollean checks with a rep notify variable (i do not include them in this post).

The last image contains the script that defines the select pawn. I have tried to put it inside the Game Mode BP and inside the Level BP of the GameMap with the same result.

This is a small project that recreates only this problem (not states, macros, etc). Is there a way to solve this issue? the player controllers? i can’t solve this!

Hi,

Sorry I am too tired to completely understand your setup, but I think you have two options. You either let the server to handle the spawning for everyone, or you replicate the spawninig/possessing from the clients to the server. In the first case, I would use the Game Mode’s PostLogin function (you can override it), which will run when a new player joins the server, and it will also give you a reference to the newly joined player’s Player Controller. In the second case, you could probably try and use an RPC from the Player Controller, so that means using a Custom Event marked as Run On Server (Reliable) and spawning/possesing your character from there.

I hope it helps you a bit.

I will try the server side handle. I thought this one would be an easy task…
The set up is a bit messy. The walkthrouh is MainMeny -> Select char-> Create or join session -> the character selection button casts to game instance where sets the SpawnChar2 bollean variable to true -> this one is detected from the Game Mode or Level Blueprint and casts back -> to game instance SpawnChar function which triggers the Spawnchar2fun function at the Spawner blueprint where after rep notify sequences executes the spawn event. Complicated? works on single game and on server…

Thank you so much for the reply!

Omg it worked! The PostLogin ovveriden function called the right controller. I used the Game Instance to store the current selected character, the post login triggered the function of spawning inside the player controller and all worked! A similar example i found is this [URL=“Multiplayer character selection. - Blueprint - Epic Developer Community Forums”] and with some modification worked.
As a next step, I will try for more clients and characters.