Dialogues not working after scene switch (with new database)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
urrmurrmur
Posts: 47
Joined: Wed May 05, 2021 1:57 pm

Dialogues not working after scene switch (with new database)

Post by urrmurrmur »

Hi,

We have an issue with our game that we can't figure out. Our game is divided into several scenes which are run through sequentially, and there is (currently) no information that needs to be passed between scenes. For now we are using a separate database for each scene, the idea being that we would never have to load more than one in memory. I know that this may not be the best approach, and we may end up changing it in the future, but at least in the short term it will have to stay like this.

Now, in the editor everything works like a charm. We have a prototype that runs through all our different scenes sequentially, and everything behaves as intended. However, when we run a build for our game, only the first loaded scene has functional dialogues, in all subsequent scenes usables that are supposed to start a conversation just do nothing when clicked. We know this doesn't have anything to do with the individual scenes, regardless of which one we set as the first scene in the build, it works as intended. It's after a scene switch that the problem occurs.

So clearly we are doing something wrong on scene switch, I just don't know what. I assume the DB from the previous scene is not unloaded when loading the next scene, which then leads to id conflicts or something similar, causing the dialogues not to fire. Either that, or the DB for the new scene is just not loaded at all. We're not actually doing anything to load or unload database at least (no code or config setting which we've changed).

Any indications what we might be forgetting? At present I'm just looking for a quick fix, since we have to submit a build in a few days, after that we can do more thorough restructuring if that turns out to be advisable.
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogues not working after scene switch (with new database)

Post by Tony Li »

Hi,

The Dialogue Manager GameObject has a few components that may cause it to survive scene changes, in which case it will supplant the Dialogue Manager in the newly-loaded scene. Check these settings:
  • Dialogue System Controller component: Other Settings > Don't Destroy On Load checkbox unticked
  • Input Device Manager component: Singleton checkbox unticked
  • The Save System component is always Don't Destroy On Load. Put it on a separate GameObject
urrmurrmur
Posts: 47
Joined: Wed May 05, 2021 1:57 pm

Re: Dialogues not working after scene switch (with new database)

Post by urrmurrmur »

Worked like a charm, thanks Tony!

Just want to say, support from you is truly above and beyond. I've never worked with any software where support was this good - lightning fast and always helpful. Very impressive and greatly appreciated!
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogues not working after scene switch (with new database)

Post by Tony Li »

Thanks for the kind words. Glad to help! :-)
Post Reply