Guides
Guides

Destination Point

extends VRTK_DestinationMarker

Overview

Allows for a specific scene marker or specific area within the scene that can be teleported to.

Prefab Usage:

  • Place the VRTK/Prefabs/DestinationPoint/DestinationPoint prefab at the desired location within the scene.
  • Uncheck the Enable Teleport checkbox to lock the destination point and prevent teleporting to it.
  • Uncheck the Snap To Point checkbox to provide a destination area rather than a specific point to teleport to.

Inspector Parameters

  • Default Cursor Object: The GameObject to use to represent the default cursor state.
  • Hover Cursor Object: The GameObject to use to represent the hover cursor state.
  • Locked Cursor Object: The GameObject to use to represent the locked cursor state.
  • Destination Location: An optional transform to determine the destination location for the destination marker. This can be useful to offset the destination location from the destination point. If this is left empty then the destiantion point transform will be used.
  • Snap To Point: If this is checked then after teleporting, the play area will be snapped to the origin of the destination point. If this is false then it's possible to teleport to anywhere within the destination point collider.
  • Hide Pointer Cursor On Hover: If this is checked, then the pointer cursor will be hidden when a valid destination point is hovered over.
  • Hide Direction Indicator On Hover: If this is checked, then the pointer direction indicator will be hidden when a valid destination point is hovered over. A pointer direction indicator will always be hidden if snap to rotation is set.
  • Snap To Rotation: Determines if the play area will be rotated to the rotation of the destination point upon the destination marker being set.
  • Teleporter: The scene teleporter that is used. If this is not specified then it will be auto looked up in the scene.

Class Variables

  • public enum RotationTypes - Allowed snap to rotation types.
    • NoRotation - No rotation information will be emitted in the destination set payload.
    • RotateWithNoHeadsetOffset - The destination point's rotation will be emitted without taking into consideration the current headset rotation.
    • RotateWithHeadsetOffset - The destination point's rotation will be emitted and will take into consideration the current headset rotation.

Class Events

  • DestinationPointEnabled - Emitted when the destination point is enabled.
  • DestinationPointDisabled - Emitted when the destination point is disabled.
  • DestinationPointLocked - Emitted when the destination point is locked.
  • DestinationPointUnlocked - Emitted when the destination point is unlocked.
  • DestinationPointReset - Emitted when the destination point is reset.

Unity Events

Adding the VRTK_DestinationPoint_UnityEvents component to VRTK_DestinationPoint object allows access to UnityEvents that will react identically to the Class Events.

  • All C# delegate events are mapped to a Unity Event with the On prefix. e.g. MyEvent -> OnMyEvent.

Class Methods

ResetDestinationPoint/0

public virtual void ResetDestinationPoint()

  • Parameters
    • none
  • Returns
    • none

The ResetDestinationPoint resets the destination point back to the default state.

Example

044_CameraRig_RestrictedTeleportZones uses the VRTK_DestinationPoint prefab to set up a collection of pre-defined teleport locations.