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

setViewTarget

setViewTarget(authority, player, entity): void

Makes entity the one player’s camera follows from the tick’s end, or the scene’s camera with null: the player’s kart as the player gets in, another player to watch while waiting, a cutscene’s rig. The player’s presence stays where it is, so watching another moves no nameplate of the player’s. The last of a setViewTarget and a control with viewTarget: true in one tick wins. Takes the room’s step, requireAuthority, or a join hook’s step for the player and what the player’s join spawned. A refusal throws in development and is logged in a deployed room, which changes nothing. As Unreal’s SetViewTarget.

Parameter Type
authority EntityAuthority
player Entity
entity Entity | null

void