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

VRTK_DestinationMarker

Overview

This abstract class provides the ability to emit events of destination markers within the game world. It can be useful for tagging locations for specific purposes such as teleporting.

It is utilised by the VRTK_WorldPointer for dealing with pointer events when the pointer cursor touches areas within the game world.

Inspector Parameters

  • Enable Teleport: If this is checked then the teleport flag is set to true in the Destination Set event so teleport scripts will know whether to action the new destination.

Class Events

  • DestinationMarkerEnter - Emitted when a collision with another game object has occurred.
  • DestinationMarkerExit - Emitted when the collision with the other game object finishes.
  • DestinationMarkerSet - Emitted when the destination marker is active in the scene to determine the last destination position (useful for selecting and teleporting).

Event Payload

  • float distance - The distance between the origin and the collided destination.
  • Transform target - The Transform of the collided destination object.
  • Vector3 destinationPosition - The world position of the destination marker.
  • bool enableTeleport - Whether the destination set event should trigger teleport.
  • uint controllerIndex The optional index of the controller emitting the beam.

Class Methods

SetInvalidTarget/1

public virtual void SetInvalidTarget(string name)

  • Parameters
  • string name - The name of the tag or class that is the invalid target.
  • Returns
  • none

The SetInvalidTarget method is used to set objects that contain the given tag or class matching the name as invalid destination targets.

SetNavMeshCheckDistance/1

public virtual void SetNavMeshCheckDistance(float distance)

  • Parameters
  • float distance - The max distance the nav mesh can be from the sample point to be valid..
  • Returns
  • none

The SetNavMeshCheckDistance method sets the max distance the destination marker position can be from the edge of a nav mesh to be considered a valid destination.

SetHeadsetPositionCompensation/1

public virtual void SetHeadsetPositionCompensation(bool state)

  • Parameters
  • bool state - The state of whether to take the position of the headset within the play area into account when setting the destination marker.
  • Returns
  • none

The SetHeadsetPositionCompensation method determines whether the offset position of the headset from the centre of the play area should be taken into consideration when setting the destination marker. If true then it will take the offset position into consideration.