Teleporter

Teleporter
The Teleporter is responsible for .... Teleporting the Player!

The Teleporter is on the root of each Hand.

The teleporter has two modes:

Node teleportation or arch teleportation.
 * Node teleportation is teleporting to the center of specific triggers.
 * Arch teleportation is teleporting on the ground, but limited by the range of an arch.

The Teleporter uses NavMesh for determining teleportable surfaces for arch teleportation. It is therefore important to bake Navigation before testing a level.

When the Teleporter receives input it makes several test to check if it is already using teleporter, already interacting with something, or if it is inside the minimum interval for teleporting or not.

The teleporter is then set to active over network.

When it is active, it will first test for teleport nodes by casting a raycast straight for a certain range, and update line based on hits.

If nothing is hit the teleporter will loop through points along an arch and raycast between then until something is hit. Then it will test for a navmesh at that point which is used to set which locations are teleportable or not.

When the player releases the teleport button and if a valid teleport location was found the player root will be teleported to the target location over the network, using either a fade transition or a blink transition.