useControlled
useControlled(
trait?):Entity[]
Every entity this side’s player controls, in the order readControlled
reads them, those holding trait alone where one is named: a list of
the units the player commands, the kart the player drives. Read again
each time a control changes and each time an entity gains or loses
trait. Empty before the player joins.
const karts = useControlled(KartTrait);Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
trait? |
Trait | PredictedTrait<any> | CoreTrait<any> |
Returns
Section titled “Returns”Entity[]