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

ViewTargetTrait

const ViewTargetTrait: CoreTrait<{ entity: Entity | null; }>

The entity a player’s camera follows, or null for the scene’s camera: the player’s character, the player’s kart, another player being watched, a cutscene’s rig. Set by setViewTarget and by a control with viewTarget: true as the tick ends, and cleared at once when its entity is destroyed. The player’s own page receives it; read it with readTrait(player, ViewTargetTrait) or useViewTarget(). As Unreal’s view target.