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

VRTK_ControllerHighlighter

Overview

The Controller Highlighter script provides methods to deal with highlighting controller elements.

The highlighting of the controller is defaulted to use the VRTK_MaterialColorSwapHighlighter if no other highlighter is applied to the Object.

Inspector Parameters

  • Transition Duration: The amount of time to take to transition to the set highlight colour.
  • Highlight Controller: The colour to set the entire controller highlight colour to.
  • Highlight Body: The colour to set the body highlight colour to.
  • Highlight Trigger: The colour to set the trigger highlight colour to.
  • Highlight Grip: The colour to set the grip highlight colour to.
  • Highlight Touchpad: The colour to set the touchpad highlight colour to.
  • Highlight Button One: The colour to set the button one highlight colour to.
  • Highlight Button Two: The colour to set the button two highlight colour to.
  • Highlight System Menu: The colour to set the system menu highlight colour to.
  • Highlight Start Menu: The colour to set the start menu highlight colour to.
  • Model Element Paths: A collection of strings that determine the path to the controller model sub elements for identifying the model parts at runtime. If the paths are left empty they will default to the model element paths of the selected SDK Bridge.
  • Element Highlighter Overrides: A collection of highlighter overrides for each controller model sub element. If no highlighter override is given then highlighter on the Controller game object is used.
  • Controller Alias: An optional GameObject to specify which controller to apply the script methods to. If this is left blank then this script is required to be placed on a Controller Alias GameObject.
  • Model Container: An optional GameObject to specifiy where the controller models are. If this is left blank then the Model Alias object will be used.

Class Methods

ConfigureControllerPaths/0

public virtual void ConfigureControllerPaths()

  • Parameters
  • none
  • Returns
  • none

The ConfigureControllerPaths method is used to set up the model element paths.

PopulateHighlighters/0

public virtual void PopulateHighlighters()

  • Parameters
  • none
  • Returns
  • none

The PopulateHighlighters method sets up the highlighters on the controller model.

HighlightController/2

public virtual void HighlightController(Color color, float fadeDuration = 0f)

  • Parameters
  • Color color - The colour to highlight the controller to.
  • float fadeDuration - The duration in time to fade from the initial colour to the target colour.
  • Returns
  • none

The HighlightController method attempts to highlight all sub models of the controller.

UnhighlightController/0

public virtual void UnhighlightController()

  • Parameters
  • none
  • Returns
  • none

The UnhighlightController method attempts to remove the highlight from all sub models of the controller.

HighlightElement/3

public virtual void HighlightElement(SDK_BaseController.ControllerElements elementType, Color color, float fadeDuration = 0f)

  • Parameters
  • SDK_BaseController.ControllerElements elementType - The element type on the controller.
  • Color color - The colour to highlight the controller element to.
  • float fadeDuration - The duration in time to fade from the initial colour to the target colour.
  • Returns
  • none

The HighlightElement method attempts to highlight a specific controller element.

UnhighlightElement/1

public virtual void UnhighlightElement(SDK_BaseController.ControllerElements elementType)

  • Parameters
  • SDK_BaseController.ControllerElements elementType - The element type on the controller.
  • Returns
  • none

The UnhighlightElement method attempts to remove the highlight from the specific controller element.

Example

VRTK/Examples/035_Controller_OpacityAndHighlighting demonstrates the ability to change the opacity of a controller model and to highlight specific elements of a controller such as the buttons or even the entire controller model.