Bark UI targeting an object in Unity UI
Bark UI targeting an object in Unity UI
Hi. I am working on a project that is done almost completely in Unity UI. I have a character in the interface who will randomly 'bark' at player actions. My problem is everything I've found related to barks target objects within the world or seem very old. I tried to make my own bark using Unity UI Bark UI which kind of works but there is a warning about this becoming obsolete. What is the best solution here?
Re: Bark UI targeting an object in Unity UI
Hi,
Unity UI Bark UI was superceded in favor of Standard Bark UI, which works similarly but is improved. It works with any canvas type.
You can also implement the C# interface IBarkUI if you want to write your own.
If you have a specific issue, what's going on?
Unity UI Bark UI was superceded in favor of Standard Bark UI, which works similarly but is improved. It works with any canvas type.
You can also implement the C# interface IBarkUI if you want to write your own.
If you have a specific issue, what's going on?
Re: Bark UI targeting an object in Unity UI
I tried using the Standard Bark UI but it would reposition the bark to the bottom corner of the screen. I guess I will keep poking it until I can get it to work.
Re: Bark UI targeting an object in Unity UI
Did you set the Canvas to Screen Space and set the position of the bark UI panel?
Here's an example exported from Unity 2019.3:
DS_ScreenSpaceBarkExample_2020-08-08.unitypackage
Here's an example exported from Unity 2019.3:
DS_ScreenSpaceBarkExample_2020-08-08.unitypackage
Re: Bark UI targeting an object in Unity UI
Thanks for your help. I had the 'Keep in View' toggled on.
Re: Bark UI targeting an object in Unity UI
Good catch. That's only for world space canvases. If you try to use it for a screen space canvas, it will try to move the panel into the camera's view in world space, but this will move it outside the canvas's screen space.
-
- Posts: 113
- Joined: Sun Sep 20, 2020 8:21 pm
Re: Bark UI targeting an object in Unity UI
In the process of attempting to move my Bark UI from world to screen space overlay because I have some post processing effects that are making the text unreadable when they are turned on. Before I dive further in to getting it looking right, is there a way to get the bark to follow the player in screen space overlay like it does with world space?
Re: Bark UI targeting an object in Unity UI
Hi,
You can still keep your bark UI in world space. Just put it on a layer that isn't affected by post processing. For example, set the bark UI's layer to "UI" and exclude the "UI" layer from post processing.
If you want to use screen space, the Extras page has two examples:
You can still keep your bark UI in world space. Just put it on a layer that isn't affected by post processing. For example, set the bark UI's layer to "UI" and exclude the "UI" layer from post processing.
If you want to use screen space, the Extras page has two examples:
- ScreenSpaceBubbleExample demonstrates a screen space bubble UI
- The UI Smooth Follow package contains a script to make a screen space UI follow an object with damping, if you want that effect