Hello, I’m trying to switch from the main menu to the game by connecting to a dedicated server session.
The problem I’m having is that I’m unable to read the player state from the server after the OnPostLogin event is executed, the default values are returned.
Below are the images of my blueprints:
When the player first loads the game map, he is directly connected to the dedicated server. in the OnPostLogin event, the playerinfo saved in the game instance is sent to be saved in the player state. and the player is spawned using the Respawn Player event, where the selected class by the player in the main menu is spawned (here is the problem)
Game Mode Function
This function retrieves the player info from player state and returns the selected class by the player in the main menu. In this function the retrieved values are correct if we are not connected to the dedicated server session, while if we are connected to the dedicated server they are the default values
This event is located in the custom player controller blueprint where it calls the set Player Info variable located in the in the custom player state blueprint
This event is located in the custom player state blueprint where it saves the sent PlayerInfo
Please help me solve this issue, it’s been almost a week and I still haven’t solved it!
Thanks in advance
I forgot to mention that I have added Delay functions just for testing, because I read that sometimes the player state takes time to be set on the server, so the function might be executed before the player state has been set