saving and loading random elements in a list

Hi I’m pretty new to c# I could really use some help.

I made a list of gameobjects, and one gameobject is chosen by the Random.Range class.

What I’ve been trying to do is save the randomly chosen gameobject and load it when the game is turned back on.

Help is greatly appreciated.

There are many different ways to go about this. Look for a good saving and loading tutorial.
But normally you’re not saving the gameobject, you’re saving data about the object. You haven’t given much info, but let’s just say your player has a weapon equiped. You don’t save the gameobject for the weapon, you save the data for the weapon. How much ammo it has. What the weapon ID is, etc. So you can just repopulate and load up what you need to.

you got the object the first time using an int that you obtained from random.range. just save that int, if your list’s order isn’t being jumbled. you can use PlayerPrefs.SetInt() and PlayerPrefs.GetInt() to persist data to harddrive between sessions

nh