Spawn Point
Updated
Marks where the player enters the scene. With several, one is picked by priority each time the player joins.
- Type
comp-spawn-point- Script class
SpawnPointComponent- Per entity
- One
- Version
- 2.0.0
Read about it in Spawn 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 |
|---|---|---|
priority |
0.1 ≤ x ≤ 1 |
|
radius |
0 ≤ x ≤ 100 |
|
slots |
1 ≤ x ≤ 256, integer |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
SpawnPoint::place
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Welcome at the spawn pointA spawn point places the main camera when play starts; its Signal Emitter sends SpawnPoint::place and a script logs where the player arrived.
Read the arrival in the script log. Drag to look around, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(SpawnPointComponent); if (component) log(component.props);}