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);Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
trait? |
PredictedTrait<any> | Trait | CoreTrait<any> |
Returns
Section titled “Returns”Entity[]