Skip to main content

SPAWN

Constant SPAWN 

Source
pub const SPAWN: FunctionDescriptor;
Expand description

Creates an entity with one record component and returns its opaque identity.

The C placeholder means one concrete type value, never a trait or primitive. Entity creation is bounded and rejected when the machine has no remaining entity capacity.

§Signature

func spawn(component: C) -> Entity

§Create an entity

A spawned component receives the first entity identity.

let entity = spawn(Vec3 {});
print(entity);