Hi, I had packed my game to test it with my friends and we discovered that the character that the Server has chosen is spawned when loaded into the map. On the other hand the client doesn’t spawn the character that the client has chosen However if I do this in the editor it works fine. I have been trying to find the issue and unfortunately I was unable to find a solution. It all seems fine to me unless I’m doing something wrong.
What the Server sees:
What the Client sees:
In the editor (All working fine):
Blueprint code when player selects what character they would like to play as and this is casted to the server info to store it, also when casting I set the custom event to “Run on owning client” (Correct me if I am wrong but the game instance is only destroyed when game is closed and each player has there own game instance):
This is how I made the Game Instance and I called it “ServerInfo” (Followed a tutorial on YouTube):
The (“CharacterStoreName”) name variable is inside the game instance (“ServerInfo”) which is where it should store the name of the character that was chosen by the player:
On event handle starting new player in the Game Mode, it casts to the Player Controller and triggers the custom event:
In the Player Controller the custom event that is “Run on owning client” is triggered and this grab the selected character name that the player selected from the Game Instance “ServerInfo” by casting to it and then this data is fed into another custom event that is “Run on server” which handles the spawning and possessing of the pawn:
Also when selecting the character this is in a different map and when everybody has selected a character then everybody loads into the map where the playing takes place. I know 100% nothing wrong with the code for checking if character has selected a character. Also I have changed the game instance in project settings to my custom one called “ServerInfo” and yes the directory is correct in the DefaultEngine.ini as it says this when opened the file
GameInstanceClass=/Game/AtoZ/Blueprints/GameInstants/ServerInfo.ServerInfo_C
I believe the directory is also correct
Please help me thanks