Travel Point
Updated
Walking into an in portal sends the player to an out portal of the same channel.
- Type
comp-travel-point- Script class
TravelPointComponent- Per entity
- One
- Version
- 2.0.0
Read about it in Spot and travel points: 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 |
|---|---|---|
appearance |
"portal" |
|
channel |
"main" |
|
color |
"" |
|
port |
"in" |
|
radius |
0.6 |
0. |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
TravelPoint::enterTravelPoint::arrive
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
A Travel Point into the vault stays closed until you press Pick up the key; then it opens with a gold ring, and walking into it lands you on the vault's out portal, which reports your arrival.
Press Pick up the key, then walk forward with W into the gold ring to travel to the vault. Drag to look around.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(TravelPointComponent); if (component) log(component.props);}