Play dialogue back to back scenes

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
brolol07
Posts: 3
Joined: Tue Dec 01, 2015 11:38 pm

Play dialogue back to back scenes

Post by brolol07 »

I have scenes that uses the dialogue editor back to back and when I play them individually they work, but when you get in game it plays the first scene fine, but not the second. I have both of the dialogue editors to trigger on the start of the scene. Any ideas?! I am kind of a beginner at this! Sorry!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Play dialogue back to back scenes

Post by Tony Li »

No worries; cross-scene stuff is often a little complicated to set up in Unity.

Here's a good way to set it up:

1. Put both conversations in the same dialogue database. (I'm assuming you're talking about playing a conversation in each scene. If not, let me know and I'll update my suggestion.)

2. Put your Dialogue Manager GameObject in the first scene. Make sure Dont Destroy On Load and Allow Only One Instance are ticked. (These are the default values.)

Image

This Dialogue Manager will carry through to the second scene.

3. You can also put a Dialogue Manager GameObject in your second scene. This will let you play the second scene in the editor without having to come in from the first scene. But keep in mind that, during regular gameplay, the Dialogue Manager from the first scene will carry over and destroy the one in the second scene.

4. Set up your Conversation Triggers (or Dialogue System Triggers) in each scene to play their respective conversations OnStart.


If it's not practical for you to merge your dialogue databases, here are two options:

1. Use the Dialogue Editor's Merge feature to combine them into one dialogue database, or

2. On both Dialogue Managers (one in each scene), untick Dont Destroy On Load. This will prevent the Dialogue Manager in the first scene from carrying over into the second and destroying the Dialogue Manager in the second scene. Be aware that the second scene won't have access to any variables you defined in the first scene's dialogue database, since they'll be using separate databases.


If that doesn't help, please let me know:
  • Are you playing a conversation in each scene OnStart? If so, are they in the same database or separate databases?
  • What trigger component are you using? (e.g., Conversation Trigger)
  • How are you changing scenes?
Please also feel free to send an example project that demonstrates the issue to tony (at) pixelcrushers.com. I'll be happy to take a look!
brolol07
Posts: 3
Joined: Tue Dec 01, 2015 11:38 pm

Re: Play dialogue back to back scenes

Post by brolol07 »

Thank you for your help! After reading your tips, I toyed with my game a bit and figured out to uncheck the don't destroy on load button because each scene has their own dialogue systems.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Play dialogue back to back scenes

Post by Tony Li »

Happy to help! :-)
Post Reply