Page 1 of 1

Bark System On Screen Space UI

Posted: Wed Jul 27, 2016 2:50 am
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?

Re: Bark System On Screen Space UI

Posted: Wed Jul 27, 2016 9:33 am
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?

Re: Bark System On Screen Space UI

Posted: Tue Oct 10, 2017 4:13 pm
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?

Re: Bark System On Screen Space UI

Posted: Tue Oct 10, 2017 7:42 pm
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

Re: Bark System On Screen Space UI

Posted: Wed Oct 11, 2017 5:22 am
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?

Re: Bark System On Screen Space UI

Posted: Wed Oct 11, 2017 1:28 pm
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.

Re: Bark System On Screen Space UI

Posted: Wed Oct 11, 2017 5:10 pm
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.

Re: Bark System On Screen Space UI

Posted: Wed Oct 11, 2017 6:56 pm
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?

Re: Bark System On Screen Space UI

Posted: Thu Oct 12, 2017 4:53 am
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!

Re: Bark System On Screen Space UI

Posted: Thu Oct 12, 2017 9:34 am
by Tony Li
Happy to help!