Unity GUI Bark UI

The Unity Bark UI component uses Unity GUI to display the text above the NPC's head. To customize the appearance, you can specify a GUI Skin and GUI Style, text style (e.g., outline or shadow), and specify when bark text is shown. You can also tick Include Name to include the barker's name in the bark text. Ticking Wait Until Sequence Ends will keep the bark text onscreen until the bark's associated cutscene sequence (if any) is over.

Notes:

  1. During gameplay, the Unity Bark UI adds a child component that contains the OnGUI() method that actually displays the bark text. The child component is only active while a bark is being displayed. It's disabled at all other times, so you don't need to worry about any overhead from an OnGUI that isn't doing anything.
  2. The scene must have a camera tagged as MainCamera.

By default, it positions the bark above the object's collider. If you specify a Text Position transform in the bark UI, the bark will be positioned at that transform instead. If you want to apply an offset, you can manually add a UnityBarkUIOnGUI component and set the (x,y,z) offset. If the barker doesn't have a collider, the text will be positioned 2 units above the transform.

Check If Player Visible is ticked by default. When ticked, the barker runs a raycast to the main camera every frame that a bark is being displayed. If the raycast hits something, such as a wall, it hides the bark. If the raycast is clear, it shows the bark. Note: If the barker doesn't have a collider, the raycast will come from the barker's transform. This is usually at the player's feet. If there are obstacles, such as bumpy terrain, between the barker's feet and the player's camera, the bark will not be visible.

Script reference: PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI


<< Bark UI | Unity UI Bark UI >>