spawn
Call Signature
Section titled “Call Signature”spawn<
Made,Options>(authority,prefab,options?):SpawnedEntity<Made,Options>
Spawns an entity of prefab, posed and with traits over the prefab’s
as options say, on the world authority decides for: the room’s step
in a system, or requireAuthority(world) outside one. A step on a page
in a room, a predicted step there and a re-run are no authority, so a
spawn from them fails to typecheck. A join hook’s step spawns too,
and a refused join takes back what it spawned. With no prefab, the entity has the
options’ traits, and a pose where they give one.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Made extends Prefab<PrefabOptions> |
- |
Options extends SpawnOptions | undefined |
undefined |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
authority |
JoinStep | Authority |
prefab |
Made |
options? |
Options |
Returns
Section titled “Returns”SpawnedEntity<Made, Options>
Call Signature
Section titled “Call Signature”spawn(
authority,options):Entity
Spawns an entity of prefab, posed and with traits over the prefab’s
as options say, on the world authority decides for: the room’s step
in a system, or requireAuthority(world) outside one. A step on a page
in a room, a predicted step there and a re-run are no authority, so a
spawn from them fails to typecheck. A join hook’s step spawns too,
and a refused join takes back what it spawned. With no prefab, the entity has the
options’ traits, and a pose where they give one.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
authority |
JoinStep | Authority |
options |
SpawnOptions |
Returns
Section titled “Returns”Entity