Teleport
Updated
Point and teleport with an aiming arc.
- Type
comp-teleport- Script class
TeleportComponent- Per entity
- One
- Version
- 3.0.0
Read about it in Teleport: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
distance |
0. |
|
slopeLimit |
0 ≤ x ≤ 90 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
Teleport::startTeleport::aimTeleport::arriveTeleport::cancelTeleport::end
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Disable teleporting during a puzzleStarting a puzzle switches the player camera's Teleport off, so the player cannot aim at all; solving it switches the Teleport back on.
Hold the right mouse button on the floor to aim, release to teleport. Press Start puzzle and try again: nothing happens until you press Solve puzzle.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(TeleportComponent); if (component) log(component.props);}