Page 1 of 1

Loading database across scenes

Posted: Sun Nov 28, 2021 1:46 am
by tootyboi95
Hi Tony,

Whenever I load my game from another scene, the dialogue system initial database does not default to the loaded scene's initial database. Rather, the database is still set to the database of the scene before I loaded the game. Any idea why? Thanks!

Re: Loading database across scenes

Posted: Sun Nov 28, 2021 8:21 am
by Tony Li
Hi,

By default, the Dialogue Manager GameObject survives scene changes. If you're using multiple dialogue databases, please see Working With Multiple Databases. Two good options are:
  • Run the databases through the Unique ID Tool. Assign one to the Dialogue Manager's Initial Database field, and assign the other(s) to an Extra Databases component. Use this same Dialogue Manager setup in all scenes.
  • Or untick the Dialogue Managers' Other Settings > Don't Destroy On Load checkboxes. Note that if you're using a different database in each scene and you've set some variables in one database in one scene, those variable values won't carry over to the next scene. (Unless you do something special such as saving and loading them, assuming the variables are defined in both databases.)