Persistent Objects

When you divide a game in more than one level you could need to keep some game data from a level to another.
An example is the player state as showed in the previous topic.
But you could need persistent data of other objects in the scenes.
 
For example imagine a document in an adventure game, imagine that the same document exists in the first 3 levels of your game, if player pick-up this document in the first level it must disappear in subsequent levels, otherwise if player doesn't pick-up it in the first level it must appear in the subsequent level.
In this case we say that the object must become persistent.
 
To make an object persistent:
  • Insert it in all level among which it must be persistent, also be sure it has the same settings in all levels.
  • Check the parameter persistentState in the object settings in all levels:
    Remember that the persistentState parameter must be check in the object in all levels.
    In the above example of the document, you should insert the document object in all 3 levels and set the persistentState parameter in the document object of all 3 levels.