Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Global objectServer APIGenerated

Camera

const Camera: object

Defined in: server/api.d.ts:4068

One player’s view, directed from the server. A shot is sent and forgotten: the server keeps no record of it, so a player who reconnects or changes level has their own view until they are sent another.

clearShot(player, duration?): boolean

Gives a player their own view back. Harmless for a player without a shot.

Player

Whose view to give back.

number

How long the glide back into the player’s eyes takes, in milliseconds: 0, the default, is a cut, and the most is 60000.

boolean

True when it was sent.

setShot(player, options): boolean

Films one player’s view from a fixed point: what a cutscene, an intro or a kill cam is made of. It holds until clearShot, or glides on to the next setShot.

This is the client’s Camera.setShot, sent to that player; whichever of the two comes last wins. Nothing about the player’s controls changes, and nothing about where their body is: their character stays where it stood, drawn head and all for as long as the camera is looking at it from outside its eyes. A player flying with NoClip refuses the shot.

Player

Whose view to film.

position is where the camera stands and lookAt the point it faces, both in world space. duration is how long it takes to get there from wherever the player’s view is, in milliseconds: 0, the default, is a cut, and the most is 60000. fov is the vertical field of view in degrees, 20 to 120; leave it out to keep the player’s own.

number

number

Vector3

Vector3

boolean

True when the shot was sent, false when position and lookAt are the same point.