Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

useControlled

useControlled(trait?): Entity[]

Every entity this side’s player controls, in the order they were spawned, those holding trait alone where one is named: a list of the units she commands, the kart she drives. Read again each time a control changes and each time an entity gains or loses trait. Empty before she joins.

const karts = useControlled(KartTrait);
Parameter Type
trait? PredictedTrait<any> | Trait | CoreTrait<any>

Entity[]