Teleport¶
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.
Note
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.
How-To¶
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.
Note
Remember you can toggle the raycast using the following command:
InterfaceManagement.Get.InterfaceRaycastActivation(bool);
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
Parameter |
Description |
---|---|
|
The color of the border of the button when the location is available. |
|
The color of the border of the button when the location is unavailable. |
|
This indicates the distance between the teleport position and the player to hide the teleport button. |
|
The distance that the player can move on the teleport position without changing its availability. |
|
The duration of the camera fade animation. |
|
Disables the availability checks for this teleport position. This position will always be available. |