Loading database across scenes

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
tootyboi95
Posts: 16
Joined: Wed Sep 29, 2021 1:51 pm

Loading database across scenes

Post 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!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Loading database across scenes

Post 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.)
Post Reply