Player loadouts from offline to online

How would you handle passing values from the offline scene to the online scene? For example, if you have a game where players can choose a loadout before joining the server, how do you get those selections to the server when the client joins? I’ve got a player prefab with methods created to equip the selections, but persisting the selections from the offline to the online scene is where I’m coming up short. For the sake of an example, let’s say the RTS lets players pick 5 unit types to come into the game with, but each player may have a different set of 5 units. What is the best way to do this?

Hi Mitch,

I suggest creating a persistent object (think DontDestroyOnLoad) that contains the information you need. Store the the information as an array of ints or a list or something and then it can be referenced when loading the next scene. If you want to remember the loadout for the next time you play you can use a saving system and right it to a file. That is more complicated though if you don’t have experience with saving systems.

This topic was automatically closed after 14 days. New replies are no longer allowed.

Privacy & Terms