Unable to get dialogues to display

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
beastsofmerit
Posts: 5
Joined: Sat Jun 26, 2021 4:51 am

Unable to get dialogues to display

Post by beastsofmerit »

Hey. I'm making a 2D game that is dialogue-heavy, and I'm trying to set up Dialogue System but after I follow the tutorials (the Triggers and Interactions one in particular), nothing happens in the game. Would really appreciate some help, since I'm new to the whole game development thing and it's very likely I've missed something.

Here's how I set up the NPC (Boar 3 which plays the role of Box1 from the tutorial video) http://prntscr.com/16vp4iu

Here's Dialogue Manager http://prntscr.com/16vqeo0

And here's the player (the Triggers and Interactions video doesn't show any components for the player, so I'm attaching this just in case) http://prntscr.com/16vphg6

All I want is for the NPC to bark "Hello" - just like in the tutorial, but nothing happens whatsoever. Furthermore, the only thing that works for me is the OnStart action from the Quick Start tutorial, but nothing else.

I clearly made a mistake somewhere and while I don't want to bore anyone, I don't think I can figure this out on my own.
User avatar
Tony Li
Posts: 21989
Joined: Thu Jul 18, 2013 1:27 pm

Re: Unable to get dialogues to display

Post by Tony Li »

Hi,

Did you tell the Dialogue System to Enable 2D Physics Support? (Tick USE_PHYSICS2D in the Dialogue System's Welcome Window, or select menu item Tools → Pixel Crushers → Common → Misc → Enable Physics2D Support....)

If you did, then inspect the Dialogue Manager GameObject and set Other Settings > Debug Level to Info. Reproduce the issue. When the player enters boar 3's trigger collider, check the Console window. You should see a message confirming that the Dialogue System Trigger is attempting to bark. If it's successful, pause the game and check boar 3's hierarchy. It's possible that the bark UI is showing, but it's just rotated wrong or sitting too high up on the screen or something like that. (Although if it looks correct when using OnStart, the bark UI probably isn't the issue.)
beastsofmerit
Posts: 5
Joined: Sat Jun 26, 2021 4:51 am

Re: Unable to get dialogues to display

Post by beastsofmerit »

Tony Li wrote: Sat Jun 26, 2021 8:59 am It's possible that the bark UI is showing, but it's just rotated wrong or sitting too high up on the screen or something like that. (Although if it looks correct when using OnStart, the bark UI probably isn't the issue.)
Thank you! That's exactly what happened - when I pause the game, I can see in the hierarchy that the bark UI is in the wrong order in layer.

Do you think you could tell me how I can tweak the size, order etc of UI elements? I tried playing around with the Canvas's render mode but it does not to affect the Bark UI element.
User avatar
Tony Li
Posts: 21989
Joined: Thu Jul 18, 2013 1:27 pm

Re: Unable to get dialogues to display

Post by Tony Li »

Hi,

The bark UI has its own world space canvas. You can duplicate the prefab, customize it, and assign your custom version to the NPC. Or just add an instance of the bark UI to the NPC in the scene, assign it to the Dialogue Actor, and customize it right in the scene.

In either case, if you want barks to display on top of everything else in the scene, see this post.

The basic bubble bark UI prefab is set up to support 3D. Since you're in 2D, you can remove the Always Face Camera component if you want. It doesn't do anything for you in 2D.
beastsofmerit
Posts: 5
Joined: Sat Jun 26, 2021 4:51 am

Re: Unable to get dialogues to display

Post by beastsofmerit »

Tony Li wrote: Sat Jun 26, 2021 11:03 am Hi,

The bark UI has its own world space canvas. You can duplicate the prefab, customize it, and assign your custom version to the NPC. Or just add an instance of the bark UI to the NPC in the scene, assign it to the Dialogue Actor, and customize it right in the scene.

In either case, if you want barks to display on top of everything else in the scene, see this post.

The basic bubble bark UI prefab is set up to support 3D. Since you're in 2D, you can remove the Always Face Camera component if you want. It doesn't do anything for you in 2D.
Thank you Tony. I got one last (hopefully) question if I may. For some reason, the bark text is attached to the player, even though only Boar3 has all the Dialogue components (including Dialogue Actor) and the bark is located inside the boar's hierarchy. No matter what I do I cannot get the text to show up above the boar. I would really appreciate some advice.
User avatar
Tony Li
Posts: 21989
Joined: Thu Jul 18, 2013 1:27 pm

Re: Unable to get dialogues to display

Post by Tony Li »

Is it possible that the bark UI is simply offset from the center of the boar so that it looks like it's over the player?

As a test, temporarily set the Dialogue System Trigger to OnStart. Then, with the player far away from the boar, play the scene. This should help tell you if the bark UI is offset or if it's really moving to where the player is.

If it's offset, inspect the Dialogue Actor and adjust the bark setting's X offset value.
beastsofmerit
Posts: 5
Joined: Sat Jun 26, 2021 4:51 am

Re: Unable to get dialogues to display

Post by beastsofmerit »

Tony Li wrote: Sat Jun 26, 2021 2:41 pm Is it possible that the bark UI is simply offset from the center of the boar so that it looks like it's over the player?

As a test, temporarily set the Dialogue System Trigger to OnStart. Then, with the player far away from the boar, play the scene. This should help tell you if the bark UI is offset or if it's really moving to where the player is.

If it's offset, inspect the Dialogue Actor and adjust the bark setting's X offset value.
Sadly, I do not think it's offset cause the bark UI is actually moving with the player as he goes back and forth. I think it has something to do with the canvas's render mode of the prefab. By default it should be set to Screen Space - Overlay? Overlay makes the Bark UI follow the player, while World Space makes it stuck above Boar3 but it's not visible even when I change the order in layer... I'm at my wit's end. I'll reinstall Dialogue System tomorrow and see what happens.
User avatar
Tony Li
Posts: 21989
Joined: Thu Jul 18, 2013 1:27 pm

Re: Unable to get dialogues to display

Post by Tony Li »

Hi,

No need to reinstall the Dialogue System.

The bark UI should be World Space. Did you set up the bark UI according to that post I linked above? Here are the steps:

1. Change your bark UI's Layer to "UI", including children.

2. Inspect your main camera, and remove "UI" from the Culling Mask dropdown. Make a note of the camera's Depth.

3. Add a child camera to your main camera. Set the position and rotation to (0,0,0) so it's in exactly the same place as the main camera. Set the Clear Flags to Depth Only, and Culling Mask to only "UI". Set Depth to a value that's higher than the main camera's Depth.
beastsofmerit
Posts: 5
Joined: Sat Jun 26, 2021 4:51 am

Re: Unable to get dialogues to display

Post by beastsofmerit »

Tony Li wrote: Sat Jun 26, 2021 3:39 pm Hi,

No need to reinstall the Dialogue System.

The bark UI should be World Space. Did you set up the bark UI according to that post I linked above? Here are the steps:

1. Change your bark UI's Layer to "UI", including children.

2. Inspect your main camera, and remove "UI" from the Culling Mask dropdown. Make a note of the camera's Depth.

3. Add a child camera to your main camera. Set the position and rotation to (0,0,0) so it's in exactly the same place as the main camera. Set the Clear Flags to Depth Only, and Culling Mask to only "UI". Set Depth to a value that's higher than the main camera's Depth.
UPD: I reinstalled the Dialogue System and it seems to work now. I don't know what'll happen next but it will have to do for now. Thank you for all your help Tony, I really appreciate it!

I did everything except for the Clear Flags thing cause I'm using the URP and 2D renderer for 2D lights and apparently there's no depth settings with the URP. Anyway, it did not change anything for me. To be honest, switching from bubble to basic made it work perfectly but then I tweaked the basic prefab and apparently broke something. That's why I'm hopeful that if I reinstall it'll work normally
User avatar
Tony Li
Posts: 21989
Joined: Thu Jul 18, 2013 1:27 pm

Re: Unable to get dialogues to display

Post by Tony Li »

Hi,

Glad you got it working!
Post Reply