How to save client variables before joining session and load them back after joining session
Let me explain what I want to do first. I'm writing with blueprints
(1) I'm writing a 2 player fighting game which has four heroes. The player has to choose a hero first then will be loaded into a map.
(2) Server player chose the hero, hosts the game and loads into the map. Everything is ok.
(3) The client player has to choose the hero before joining the session. Then joins the session and loads into the map of server player.
(4) To store which hero is chosen by client, I stored the index of hero into a variable named P2Hero in playerState blueprint.( This step occurs before joining the session )
(5) After joining the session, and onPostLogin event, I want to get back the saved P2Hero variable from client's playerState blueprint but it seems like it is getting the variable from another playerState blueprint and just gives the default value of the variable 0.
(6) My main point is how to save datas of client before joining the session and how to load them back after joining the session.
Someone pls help me. I'm having a really big trouble. I've tried saving the data in gameInstance, gameMode, playerController. All of them just gives the default value like mentioned above. May be the whole logic of mine is wrong. If wrong pls point me how to solve this problem. Thanks.
answered Apr 21 '16 at 07:50 PM
Did you ever find a "proper way" to do this? I'm having the exact same problem.
answered Mar 24 '17 at 03:45 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here