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

VRTK_DashTeleport

extends VRTK_HeightAdjustTeleport

Overview

The dash teleporter extends the height adjust teleporter and allows to have the user's position dashing to a new teleport location.

The basic principle is to dash for a very short amount of time, to avoid sim sickness. The default value is 100 miliseconds. This value is fixed for all normal and longer distances. When the distances get very short the minimum speed is clamped to 50 mps, so the dash time becomes even shorter.

The minimum distance for the fixed time dash is determined by the minSpeed and normalLerpTime values, if you want to always lerp with a fixed mps speed instead, set the normalLerpTime to a high value. Right before the teleport a capsule is cast towards the target and registers all colliders blocking the way. These obstacles are then broadcast in an event so that for example their gameobjects or renderers can be turned off while the dash is in progress.

Inspector Parameters

  • Normal Lerp Time: The fixed time it takes to dash to a new position.
  • Min Speed Mps: The minimum speed for dashing in meters per second.
  • Capsule Top Offset: The Offset of the CapsuleCast above the camera.
  • Capsule Bottom Offset: The Offset of the CapsuleCast below the camera.
  • Capsule Radius: The radius of the CapsuleCast.

Class Events

  • WillDashThruObjects - Emitted when the CapsuleCast towards the target has found that obstacles are in the way.
  • DashedThruObjects - Emitted when obstacles have been crossed and the dash has ended.

Unity Events

Adding the VRTK_DashTeleport_UnityEvents component to VRTK_DashTeleport object allows access to UnityEvents that will react identically to the Class Events.

  • OnWillDashThruObjects - Emits the WillDashThruObjects class event.
  • OnDashedThruObjects - Emits the DashedThruObjects class event.

Event Payload

  • RaycastHit[] hits - An array of objects that the CapsuleCast has collided with.

Example

SteamVR_Unity_Toolkit/Examples/038_CameraRig_DashTeleport shows how to turn off the mesh renderers of objects that are in the way during the dash.