{"__v":0,"_id":"58796781cd4a9c37007c9702","category":{"version":"58796781cd4a9c37007c96ef","project":"571fa55ca0acd42000af9545","_id":"58796781cd4a9c37007c96f3","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T16:41:26.797Z","from_sync":false,"order":4,"slug":"locomotion","title":"Locomotion"},"parentDoc":null,"project":"571fa55ca0acd42000af9545","user":"571fa519db52d01700f5cf3d","version":{"__v":4,"_id":"58796781cd4a9c37007c96ef","project":"571fa55ca0acd42000af9545","createdAt":"2017-01-13T23:49:21.393Z","releaseDate":"2017-01-13T23:49:21.393Z","categories":["58796781cd4a9c37007c96f0","58796781cd4a9c37007c96f1","58796781cd4a9c37007c96f2","58796781cd4a9c37007c96f3","58796781cd4a9c37007c96f4","58796781cd4a9c37007c96f5","58796781cd4a9c37007c96f6","58796781cd4a9c37007c96f7","58796781cd4a9c37007c96f8","58796781cd4a9c37007c96f9","58796781cd4a9c37007c96fa","58796781cd4a9c37007c96fb","58796781cd4a9c37007c96fc","58796781cd4a9c37007c96fd","58796781cd4a9c37007c96fe","58796781cd4a9c37007c96ff","58796781cd4a9c37007c9700","58b157ca1756cf370022f90d","58b1596f5dae732f00adeca2","58b1605a5dae732f00adecb1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Mukota","version_clean":"3.1.0","version":"3.1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-01-01T16:42:19.304Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"## Overview\n\nThe basic teleporter updates the user's x/z position in the game world to the position of a Base Pointer's tip location which is set via the `DestinationMarkerSet` event.\n\nThe y position is never altered so the basic teleporter cannot be used to move up and down game objects as it only allows for travel across a flat plane.\n\n## Inspector Parameters\n\n * **Blink Transition Speed:** The fade blink speed can be changed on the basic teleport script to provide a customised teleport experience. Setting the speed to 0 will mean no fade blink effect is present.\n * **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.\n * **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.\n * **Target List Policy:** A specified VRTK_PolicyList to use to determine whether destination targets will be acted upon by the Teleporter.\n * **Nav Mesh Limit Distance:** The max distance the teleport destination can be outside the nav mesh to be considered valid. If a value of `0` is given then the nav mesh restrictions will be ignored.\n\n## Class Events\n\n * `Teleporting` - Emitted when the teleport process has begun.\n * `Teleported` - Emitted when the teleport process has successfully completed.\n\n## Unity Events\n\nAdding the `VRTK_BasicTeleport_UnityEvents` component to `VRTK_BasicTeleport` object allows access to `UnityEvents` that will react identically to the Class Events.\n\n * `OnTeleporting` - Emits the Teleporting class event.\n * `OnTeleported` - Emits the Teleported class event.\n\n## Event Payload\n\n * `float distance` - The distance between the origin and the collided destination.\n * `Transform target` - The Transform of the collided destination object.\n * `RaycastHit raycastHit` - The optional RaycastHit generated from when the ray collided.\n * `Vector3 destinationPosition` - The world position of the destination marker.\n * `bool forceDestinationPosition` - If true then the given destination position should not be altered by anything consuming the payload.\n * `bool enableTeleport` - Whether the destination set event should trigger teleport.\n * `uint controllerIndex` - The optional index of the controller emitting the beam.\n\n## Class Methods\n\n### InitDestinationSetListener/2\n\n  > `public virtual void InitDestinationSetListener(GameObject markerMaker, bool register)`\n\n  * Parameters\n   * `GameObject markerMaker` - The game object that is used to generate destination marker events, such as a controller.\n   * `bool register` - Determines whether to register or unregister the listeners.\n  * Returns\n   * _none_\n\nThe InitDestinationSetListener method is used to register the teleport script to listen to events from the given game object that is used to generate destination markers. Any destination set event emitted by a registered game object will initiate the teleport to the given destination location.\n\n### ToggleTeleportEnabled/1\n\n  > `public virtual void ToggleTeleportEnabled(bool state)`\n\n  * Parameters\n   * `bool state` - Toggles whether the teleporter is enabled or disabled.\n  * Returns\n   * _none_\n\nThe ToggleTeleportEnabled method is used to determine whether the teleporter will initiate a teleport on a destination set event, if the state is true then the teleporter will work as normal, if the state is false then the teleporter will not be operational.\n\n### ValidLocation/2\n\n  > `public virtual bool ValidLocation(Transform target, Vector3 destinationPosition)`\n\n  * Parameters\n   * `Transform target` - The Transform that the destination marker is touching.\n   * `Vector3 destinationPosition` - The position in world space that is the destination.\n  * Returns\n   * `bool` - Returns true if the target is a valid location.\n\nThe ValidLocation method determines if the given target is a location that can be teleported to\n\n## Example\n\n`VRTK/Examples/004_CameraRig_BasicTeleport` uses the `VRTK_SimplePointer` script on the Controllers to initiate a laser pointer by pressing the `Touchpad` on the controller and when the laser pointer is deactivated (release the `Touchpad`) then the user is teleported to the location of the laser pointer tip as this is where the pointer destination marker position is set to.","excerpt":"","slug":"vrtk_basicteleport","type":"basic","title":"VRTK_BasicTeleport"}

VRTK_BasicTeleport


## Overview The basic teleporter updates the user's x/z position in the game world to the position of a Base Pointer's tip location which is set via the `DestinationMarkerSet` event. The y position is never altered so the basic teleporter cannot be used to move up and down game objects as it only allows for travel across a flat plane. ## Inspector Parameters * **Blink Transition Speed:** The fade blink speed can be changed on the basic teleport script to provide a customised teleport experience. Setting the speed to 0 will mean no fade blink effect is present. * **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. * **Target List Policy:** A specified VRTK_PolicyList to use to determine whether destination targets will be acted upon by the Teleporter. * **Nav Mesh Limit Distance:** The max distance the teleport destination can be outside the nav mesh to be considered valid. If a value of `0` is given then the nav mesh restrictions will be ignored. ## Class Events * `Teleporting` - Emitted when the teleport process has begun. * `Teleported` - Emitted when the teleport process has successfully completed. ## Unity Events Adding the `VRTK_BasicTeleport_UnityEvents` component to `VRTK_BasicTeleport` object allows access to `UnityEvents` that will react identically to the Class Events. * `OnTeleporting` - Emits the Teleporting class event. * `OnTeleported` - Emits the Teleported class event. ## Event Payload * `float distance` - The distance between the origin and the collided destination. * `Transform target` - The Transform of the collided destination object. * `RaycastHit raycastHit` - The optional RaycastHit generated from when the ray collided. * `Vector3 destinationPosition` - The world position of the destination marker. * `bool forceDestinationPosition` - If true then the given destination position should not be altered by anything consuming the payload. * `bool enableTeleport` - Whether the destination set event should trigger teleport. * `uint controllerIndex` - The optional index of the controller emitting the beam. ## Class Methods ### InitDestinationSetListener/2 > `public virtual void InitDestinationSetListener(GameObject markerMaker, bool register)` * Parameters * `GameObject markerMaker` - The game object that is used to generate destination marker events, such as a controller. * `bool register` - Determines whether to register or unregister the listeners. * Returns * _none_ The InitDestinationSetListener method is used to register the teleport script to listen to events from the given game object that is used to generate destination markers. Any destination set event emitted by a registered game object will initiate the teleport to the given destination location. ### ToggleTeleportEnabled/1 > `public virtual void ToggleTeleportEnabled(bool state)` * Parameters * `bool state` - Toggles whether the teleporter is enabled or disabled. * Returns * _none_ The ToggleTeleportEnabled method is used to determine whether the teleporter will initiate a teleport on a destination set event, if the state is true then the teleporter will work as normal, if the state is false then the teleporter will not be operational. ### ValidLocation/2 > `public virtual bool ValidLocation(Transform target, Vector3 destinationPosition)` * Parameters * `Transform target` - The Transform that the destination marker is touching. * `Vector3 destinationPosition` - The position in world space that is the destination. * Returns * `bool` - Returns true if the target is a valid location. The ValidLocation method determines if the given target is a location that can be teleported to ## Example `VRTK/Examples/004_CameraRig_BasicTeleport` uses the `VRTK_SimplePointer` script on the Controllers to initiate a laser pointer by pressing the `Touchpad` on the controller and when the laser pointer is deactivated (release the `Touchpad`) then the user is teleported to the location of the laser pointer tip as this is where the pointer destination marker position is set to.