Skip to content

Map Point

eisclimber edited this page Nov 3, 2024 · 3 revisions

Map Point

class in ExPresSXR.Movement / Extends MonoBehavior
Component added via Component Menu / GameObject instantiable via ExPresS XRMap Point Teleport/Map Point

Description

Acts as a central location from which the player can teleport to other locations. This is especially useful if the other locations are far away or there is no line of sight, as regular teleports would not be possible in this case.

It provides functionality to hide/show certain objects when teleporting or the player is not present.
You will usually want to add a PlayerDetector control SetPlayerPresent() with its Events. Otherwise the visibility of _playerPresentVisibleand its children will not be affected.

The default prefab also allows teleportation at the MapPoint itself, indicated by the white are on the floor.

Members

Public Properties

  • GameObject _showInTpMode: Visible when the player is in TP-Mode.
    Attention!: This GameObject will stay be visible/active when the player is NOT present. To hide it, configure this as (child) of _playerPresentVisible.
  • GameObject _hideInTpMode: Visible when the player is NOT in TP-Mode.
    Attention!: This GameObject will stay be visible/active when the player is NOT present. To hide it, configure this as (child) of _playerPresentVisible.
  • GameObject _playerPresentVisible: Visible only when the player is present.
    Attention!: You will usually want to add a PlayerDetector control SetPlayerPresent() with its Events. Otherwise the visibility of _playerPresentVisibleand its children will not be affected.
  • float _createdTpOptionRadius: Default distance at which new teleport options are placed.
    TP-Options will always be placed at the origin of this transform but their first object will be shifted by Vector3.forward * _createdTpOptionRadius
    Default: DEFAULT_TP_OPTION_CREATION_RADIUS

Public Methods

  • void SetTeleportModeVisible(bool visible): Changes visibility of the 'Show In TP Mode' and 'Hide In TP Mode' GameObjects. Their state will be always inverse ('Show In TP Mode'.active = !'Hide In TP Mode'.active).
  • void SetPlayerPresent(bool present): (De-)activates the 'Player Present' GameObject.
  • void CreateNewTpOptionObject(): Creates the a new default 'TP-Option'-GameObject at Vector3.forward * _createdTpOptionRadius.
    Make sure to configure it properly by setting a destination and rotating/moving it.
    Attention!: Only available in the editor.

Constants

  • string TP_OPTION_PATH = "Movement/Teleport Option": ExPresS XR Prefab Path to the default 'Teleport Option'-Prefab.
  • float DEFAULT_TP_OPTION_CREATION_RADIUS = 2.0f: Default distance at which new teleport options are placed.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally