Skip to content

Camera

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

Inherits: Dynamic

Properties

  • Mode: CameraModeEnum
  • FOV: number
  • ClipThroughWalls: boolean
  • MinDistance: number
  • MaxDistance: number
  • Distance: number
  • ScrollSensitivity: number
  • Orthographic: boolean
  • FollowLerp: boolean
  • LerpSpeed: number
  • OrthographicSize: number
  • PositionOffset: Vector3
  • RotationOffset: Vector3
  • IsFirstPerson: boolean
  • CanLock: boolean
  • SensitivityMultiplier: number
  • Sensitivity: number
  • HorizontalSpeed: number
  • VerticalSpeed: number
  • ScrollLerpSpeed: number
  • CtrlLocked: boolean
  • AlwaysLocked: boolean
  • Target: Dynamic

Methods

ViewportPointToRay(pos: Vector2, ignoreList: { Instance }, maxDistance: number) → RayResult

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(pos: Vector2, ignoreList: { Instance }, maxDistance: number) → RayResult

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

ViewportToScreenPoint(pos: Vector2) → Vector2

Transforms pos from viewport space into screen space.

ViewportToWorldPoint(pos: Vector2) → Vector3

Transforms pos from viewport space into world space.

WorldToViewportPoint(pos: Vector3) → Vector2

Transforms pos from world space into viewport space.

WorldToScreenPoint(pos: Vector3) → Vector2

Transforms pos from world space into screen space.

ScreenToViewportPoint(pos: Vector2) → Vector2

Transforms pos from screen space into viewport space.

ScreenToWorldPoint(pos: Vector2) → Vector3

Transforms pos from screen space into world space.

Events

  • FirstPersonEntered: Fires when camera has entered first person
  • FirstPersonExited: Fires when camera has exited first person