Guides
These docs are for v2.1.0. Click to read the latest docs for v3.3.0.

ObjectTooltip

Overview

This adds a UI element into the World Space that can be used to provide additional information about an object by providing a piece of text with a line drawn to a destination point.

There are a number of parameters that can be set on the Prefab which are provided by the SteamVR_Unity_Toolkit/Scripts/VRTK_ObjectTooltip script which is applied to the prefab.

Inspector Parameters

  • Display Text: The text that is displayed on the tooltip.
  • Font Size: The size of the text that is displayed.
  • Container Size: The size of the tooltip container where x = width and y = height.
  • Draw Line From: An optional transform of where to start drawing the line from. If one is not provided the the centre of the tooltip is used for the initial line position.
  • Draw Line To: A transform of another object in the scene that a line will be drawn from the tooltip to, this helps denote what the tooltip is in relation to. If no transform is provided and the tooltip is a child of another object, then the parent object's transform will be used as this destination position.
  • Line Width: The width of the line drawn between the tooltip and the destination transform.
  • Font Color: The colour to use for the text on the tooltip.
  • Container Color: The colour to use for the background container of the tooltip.
  • Line Color: The colour to use for the line drawn between the tooltip and the destination transform.

Example

SteamVR_Unity_Toolkit/Examples/029_Controller_Tooltips displays two cubes that have an object tooltip added to them along with tooltips that have been added to the controllers.