The TeleportLocation prefab makes teleporting to a location easy, regardless of the camera in use. Simply place the prefab to the location that you want to teleport to. When you press the button, you will get teleported to that location with a smooth camera fade in / out animation.


Above you can see the TeleportLocation prefab, which consists of a button and an avatar. The avatar indicates the position and orientation of the player after the teleport. When you hover over the button, the avatar gets enabled and when you stop hovering, it gets disabled again.


When the player gets within a predefined Hiding_Distance (see Inspector Fields section) from the TeleportLocation , the button gets disabled so that it does not block / interfere with the vision of the player.


You can find the TeleportLocation prefab on the MAGES menu under the path: MAGES/UIs/Teleport Location.


When you do that, the TeleportLocation prefab will get spawn on the scene and you can place it wherever you want to teleport to. You can start the teleport by clicking the button with your raycasts.


Remember you can toggle the raycast using the following command:


The raycast can be used to interact with the teleport button.

Inspector Fields

Below there is the table of the inspector extra slider parameters and what they do.

class TeleportLocationControl



Color Available_Color

The color of the border of the button when the location is available.

Color Unavailable_Color

The color of the border of the button when the location is unavailable.

float Hiding_Distance

This indicates the distance between the teleport position and the player to hide the teleport button.

float Move_Threshold

The distance that the player can move on the teleport position without changing its availability.

float Camera_Fade_Duration

The duration of the camera fade animation.

bool Disable_Availability_Check

Disables the availability checks for this teleport position. This position will always be available.