Skip to content

Height Adjust Teleport

StoneFox edited this page Jun 6, 2016 · 1 revision

[VRTK_HeightAdjustTeleport]

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.

The following script parameters are available:

  • 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.
  • Play Space Falling: Checks if the player 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 player's headset is above an object then the player 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 player can hover in mid air at the same y position of the object they are standing on.

An example of the VRTK_HeightAdjustTeleport script can be viewed in the scene SteamVR_Unity_Toolkit/Examples/007_CameraRig_HeightAdjustTeleport. The scene has a collection of varying height objects that the player can either walk up and down or use the laser pointer to climb on top of them.

Another example can be viewed in the scene SteamVR_Unity_Toolkit/Examples/010_CameraRig_TerrainTeleporting which shows how the teleportation of a player can also traverse terrain colliders.

Another example can be viewed in the scene SteamVR_Unity_Toolkit/Examples/020_CameraRig_MeshTeleporting which shows how the teleportation of a player can also traverse mesh colliders.

Clone this wiki locally