Save and load Object variable for each instance

I’m creating enemy object by clicking right mouse button. Each enemy object have object variable of ID, Skin, Health, and Age. Now i want to save each variable so i can get each data when I open the game again.

Now how i can save each object variable of every enemy and load it again.

This is my object variable for my enemy

This is my code for creating the enemy and put a random value for the health object variable.

OUTPUT

This example might help you.

1 Like