Skip to content

Camera

Inherits Dynamic

Camera is a class that represents the local player's camera.

Properties

Mode : CameraMode

Determines or returns the camera's current mode.

FOV : number

Determines or returns the camera's field of view.

ClipThroughWalls : boolean

Determines whether or not the camera should clip through walls.

MinDistance : number

The camera's minimum distance from the player in Follow mode.

MaxDistance : number

Determines camera's maximum distance from the player in Follow mode.

Distance : number

Determines the distance between the camera and the player when the camera is in Follow mode.

ScrollSensitivity : number

Determines the scroll move speed of the camera.

Orthographic : boolean

Determines whether or not the camera should render in orthographic (2D) mode or not (3D).

FollowLerp : boolean

Determines whether or not to use lerping in Follow mode.

LerpSpeed : number

Determines the lerp speed of the camera when lerping is enabled.

OrthographicSize : number

Determines the half-size of the camera when in orthographic mode.

PositionOffset : Vector3

Determines the camera's offset from its position.

RotationOffset : Vector3

Determines the camera's offset from its rotation.

IsFirstPerson : boolean

Returns whether or not the camera is in first person.

CanLock : boolean

Determine if camera can be ctrl locked.

SensitivityMultiplier : number

Multipler for camera sensitivity

Sensitivity : number

Current sensitivity of the camera

HorizontalSpeed : number

Determines the horizontal movement speed of the camera in Follow mode.

VerticalSpeed : number

Determines the vertical move speed of the camera.

ScrollLerpSpeed : number

Determines the lerp amount when scrolling

CtrlLocked : boolean

Determine if camera is in Ctrl lock mode

AlwaysLocked : boolean

Determine if camera should always be in locked mode

Target : Dynamic

The target of Follow mode

Methods

ViewportPointToRay → RayResult

Parameters

pos [ Vector2 ]

ignoreList [ table? ]

maxDistance [ number? ]

Cast a ray from the camera at the specified ViewportPoint (Vector3 with components with values in range of 0 - 1 describing how far a point is to to right and to the top of the screen) into the game world

ScreenPointToRay → RayResult

Parameters

pos [ Vector2 ]

ignoreList [ table? ]

maxDistance [ number? ]

Cast a ray from the camera at screen point into the game world

ViewportToScreenPoint → Vector2

Parameters: pos [ Vector2 ]

Transforms pos from viewport space into screen space.

ViewportToWorldPoint → Vector3

Parameters: pos [ Vector2 ]

Transforms pos from viewport space into world space.

WorldToViewportPoint → Vector2

Parameters: pos [ Vector3 ]

Transforms pos from world space into viewport space.

WorldToScreenPoint → Vector2

Parameters: pos [ Vector3 ]

Transforms pos from world space into screen space.

ScreenToViewportPoint → Vector2

Parameters: pos [ Vector2 ]

Transforms pos from screen space into viewport space.

ScreenToWorldPoint → Vector3

Parameters: pos [ Vector2 ]

Transforms pos from screen space into world space.

Events

FirstPersonEntered

Parameters: ``

Fires when camera has entered first person

FirstPersonExited

Parameters: ``

Fires when camera has exited first person