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

VRTK_HeightAdjustTeleport

extends VRTK_BasicTeleport

Overview

The height adjust teleporter extends the basic teleporter and allows for the y position of the [CameraRig] to be altered based on whether the teleport location is on top of another object.

Like the basic teleporter the Height Adjust Teleport script is attached to the [CameraRig] prefab and requires a World Pointer to be available.

Inspector Parameters

  • Blink Transition Speed: The fade blink speed on teleport.
  • Distance Blink Delay: A range between 0 and 32 that determines how long the blink transition will stay blacked out depending on the distance being teleported. A value of 0 will not delay the teleport blink effect over any distance, a value of 32 will delay the teleport blink fade in even when the distance teleported is very close to the original position. This can be used to simulate time taking longer to pass the further a user teleports. A value of 16 provides a decent basis to simulate this to the user.
  • Headset Position Compensation: If this is checked then the teleported location will be the position of the headset within the play area. If it is unchecked then the teleported location will always be the centre of the play area even if the headset position is not in the centre of the play area.
  • Ignore Target With Tag Or Class: A string that specifies an object Tag or the name of a Script attached to an obejct and notifies the teleporter that the destination is to be ignored so the user cannot teleport to that location. It also ensure the pointer colour is set to the miss colour.
  • Nav Mesh Limit Distance: The max distance the nav mesh edge can be from the teleport destination to be considered valid. If a value of 0 is given then the nav mesh restriction will be ignored.
  • Play Space Falling: Checks if the user steps off an object into a part of their play area that is not on the object then they are automatically teleported down to the nearest floor. The Play Space Falling option also works in the opposite way that if the user's headset is above an object then the user is teleported automatically on top of that object, which is useful for simulating climbing stairs without needing to use the pointer beam location. If this option is turned off then the user can hover in mid air at the same y position of the object they are standing on.
  • Use Gravity: allows for gravity based falling when the distance is greater than Gravity Fall Height.
  • Gravity Fall Height: Fall distance needed before gravity based falling can be triggered.
  • Blink Y Threshold: The y distance between the floor and the headset that must change before the fade transition is initiated. If the new user location is at a higher distance than the threshold then the headset blink transition will activate on teleport. If the new user location is within the threshold then no blink transition will happen, which is useful for walking up slopes, meshes and terrains where constant blinking would be annoying.

Example

SteamVR_Unity_Toolkit/Examples/007_CameraRig_HeightAdjustTeleport has a collection of varying height objects that the user can either walk up and down or use the laser pointer to climb on top of them.

SteamVR_Unity_Toolkit/Examples/010_CameraRig_TerrainTeleporting shows how the teleportation of a user can also traverse terrain colliders.

SteamVR_Unity_Toolkit/Examples/020_CameraRig_MeshTeleporting shows how the teleportation of a user can also traverse mesh colliders.