Hi,
I’m struggling with the same issue and know the problems that you descibed above very well. The only difference is that I’m using Blueprints instead of C++.
My logic looks like this:
- In the “Customize” section of the main menu you can modify your character (skin color, hair variations, etc.) and write the data into a savegame
- If you join a online session, you can join either the red or the blue team inside the lobby. The chosen/assigned team will be saved in your game instance as it’s the only persistent data storage class
- After a server travel to the play map, the game mode tells player controllers on post login to spawn their player pawns and this is the point where the problems begin…
- The player pawns get the stored data from the game instance on begin play and use this information to set their own name and to determine their team color (which will be set in a dynamic material instance depending on the assigned team; red or blue)
This works without any problems on the server (and without delay) but it does not work on the client immediately after spawning the player pawn because the casting of the game instance fails on begin play on the client side. I’ve built a macro that runs every frame on begin play till the cast will be successful once. This seems like a dirty workaround but I could not find another solution for this problem. Maybe it would be possible with event dispatchers but I have to try this out.
Did you manage to find a good solution so far?
Best regards,
Daniel