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

VRTK_OutlineObjectCopyHighlighter

extends VRTK_BaseHighlighter

Overview

The Outline Object Copy Highlighter works by making a copy of a mesh and adding an outline shader to it and toggling the appearance of the highlighted object.

Inspector Parameters

  • Thickness: The thickness of the outline effect
  • Custom Outline Model: The GameObject to use as the model to outline. If one isn't provided then the first GameObject with a valid Renderer in the current GameObject hierarchy will be used.
  • Custom Outline Model Path: A path to a GameObject to find at runtime, if the GameObject doesn't exist at edit time.

Class Methods

Initialise/2

public override void Initialise(Color? color = null, Dictionary<string, object> options = null)

  • Parameters
  • Color? color - Not used.
  • Dictionary<string, object> options - A dictionary array containing the highlighter options:\r <'thickness', float> - Same as thickness inspector parameter.\r <'customOutlineModel', GameObject> - Same as customOutlineModel inspector parameter.\r * <'customOutlineModelPath', string> - Same as customOutlineModelPath inspector parameter.
  • Returns
  • none

The Initialise method sets up the highlighter for use.

Highlight/2

public override void Highlight(Color? color, float duration = 0f)

  • Parameters
  • Color? color - The colour to outline with.
  • float duration - Not used.
  • Returns
  • none

The Highlight method initiates the outline object to be enabled and display the outline colour.

Unhighlight/2

public override void Unhighlight(Color? color = null, float duration = 0f)

  • Parameters
  • Color? color - Not used.
  • float duration - Not used.
  • Returns
  • none

The Unhighlight method hides the outline object and removes the outline colour.

Example

VRTK/Examples/005_Controller_BasicObjectGrabbing demonstrates the outline highlighting on the green sphere when the controller touches it.

VRTK/Examples/035_Controller_OpacityAndHighlighting demonstrates the outline highlighting if the left controller collides with the green box.