1. Home
  2. Docs
  3. Save Game Pro
  4. Best Practices
  5. Runtime Instantiated Objects

Runtime Instantiated Objects

This article is under development

In some projects, there large amount of runtime instantiated objects that cannot be saved as individual files, in this case you need to make a new Data structure to arrange instantiated objects then save them to local storage and load them back and instantiate objects using the loaded data, it is very much like saving an object position, then loading the position and instantiating the object according to the position, but for a larger amount of objects, you need a wrapper to wrap around these information, such as position, color, scale, ….

The first that everyone does is to use Save Game API to save and load the GameObject completely, but it is not a good practice at all, because it is heavy, slow and uncontrollable for our case, so we are going to save useful information about the objects, so let us start with an example.

Example: we want to instantiate objects by mouse click, then select the instantiated object and adjust some color and scale, then save all of them, so for the first we need the data structure for these information, and the data structure for these information is as follow:


Was this article helpful to you? Yes No 13

How can we help?