Bark System On Screen Space UI

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
SanX91
Posts: 1
Joined: Wed Jul 27, 2016 2:46 am

Bark System On Screen Space UI

Post by SanX91 »

Hi,

I need to run the BarkOnIdle method on Screen Space - Overlay UI along with the other dialogs and responses. Is that possible? It's just that I have to fit in all the dialogs under one canvas. Or, is there some other alternative for barking, which can be used for randomizing or looping conversations?
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark System On Screen Space UI

Post by Tony Li »

Hi,

Sure, there's no requirement to use a world space canvas. The examples and prefabs are just set up that way because it's the most common use case. The instructions say to create a canvas as a child of the NPC, but if you already have a screen space canvas you can just point the Unity UI Bark UI component's properties to that canvas instead.

If you get stuck or have any other questions about this, just let me know. Also feel free to send an example to tony (at) pixelcrushers.com and let me know what version of Unity to use. I'll be happy to take a look.

Randomizing and/or looping conversations is a separate subject, but easy to do in the Dialogue System. Can you please give me more details about what you'd like to do?
OneManOnMars
Posts: 105
Joined: Tue Apr 05, 2016 9:37 am

Re: Bark System On Screen Space UI

Post by OneManOnMars »

Hi Tony and SanX91,

alright, this thread is a bit older, but I thought since I am working on the same topic I just post my question here.

I have everything set up and one of my character barks BUT only if I activate the Bubble Panel myself using a proximity trigger and an event responder. So when the character gets near it activates the bubble Panel Gameobject (which includes the Subline, Name and so on. Just using the same as Worldspace Canvas as for conversations)

What would be the right way to get that panel active?
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark System On Screen Space UI

Post by Tony Li »

Hi,

The Unity UI Bark UI component looks for a canvas on itself or a child GameObject. It keeps this canvas inactive except during barks.

Can you set up a world space canvas just for barks? If you're also using a world space canvas for interactive conversations, use a different world space canvas.

The hierarchy might look something like this:
  • NPC
    • Canvas (world space) with a Unity UI Bark UI component
      • Bubble Panel
        • Bark Text
        • Name Text
OneManOnMars
Posts: 105
Joined: Tue Apr 05, 2016 9:37 am

Re: Bark System On Screen Space UI

Post by OneManOnMars »

Thank you, Tony, for your fast reply.

I duplicated the speech bubble canvas and removed the unneeded stuff like continue button and put it directly below the GO of the NPC.

Image

But still, the panel gets deactivated on start and I have to activate it myself, or via a trigger.

How is the bark activated anyway? Just via the BarkonIdle?
Is there an animation state needed in any way?

:?:

In addition, it seems that for standard dialogues (triggered by a dialogue trigger) now the Bark bubble canvas is used not the Speech Bubble Canvas.
Image

How can I make sure for dialogues the dialogue canvas gets used und for barks the bark canvas?
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark System On Screen Space UI

Post by Tony Li »

Hi,

Move the Unity UI Bark UI component to Bark Bubble Canvas_la. This will ensure that it automatically finds the bark canvas.
OneManOnMars
Posts: 105
Joined: Tue Apr 05, 2016 9:37 am

Re: Bark System On Screen Space UI

Post by OneManOnMars »

I am sorry, but it does not help. The panel stays inactive.
A well I fixed it with triggers and event responders. But in general, it would be cool to know how to start and end barks. Maybe this is what is missing. The start script. I am not sure.
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark System On Screen Space UI

Post by Tony Li »

Can you send an example scene to tony (at) pixelcrushers.com?

As a test, what happens if you remove your custom bark UI and temporarily add the prefab "Generic Unity UI Bark UI" as a child of KARA?
OneManOnMars
Posts: 105
Joined: Tue Apr 05, 2016 9:37 am

Re: Bark System On Screen Space UI

Post by OneManOnMars »

Awesome, that was the clue! Comparing the two UIs was very helpful. I guess the Override Unity UI Dialog UI was interfering. It was on the canvas and I did not send a picture of that :cry: But it is working fine now. Thank you!

This is the best support ever!
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark System On Screen Space UI

Post by Tony Li »

Happy to help!
Post Reply