Skip to content

CameraLens

Class ยท server and client scripts

CameraLens configures a camera entity's perspective field of view, clip planes, render layer cull mask, and optional oblique clip plane. Access it through camera.CameraLens.

Example

-- Client script.
local cam = World.Viewport.Camera
local lens = cam and cam.CameraLens
if lens then
    lens.FovY = math.rad(75)
    lens.NearZ = 0.2
    lens.FarZ = 1500
end

FovY

Property
FovY: number

FovY is the field of view, in radians, across the viewport axis selected by FovAxis.

Default 1.22173

NearZ

Property
NearZ: number

NearZ is the near clip plane distance in world units.

Default 0.1

FarZ

Property
FarZ: number

FarZ is the far clip plane distance in world units.

Default 1000

FovAxis

Property
FovAxis: number

FovAxis chooses which viewport axis FovY spans: 0 for view height, and 1 for view width.

Default 0

ClipEnabled

Property
ClipEnabled: boolean

ClipEnabled clips geometry behind the plane defined by ClipNormal and ClipOffset on secondary views such as portals and mirrors.

Default false

CullMask

Property
CullMask: number

CullMask is the bitmask of RenderMask layers rendered by this camera; -1 draws all layers.

Default -1

ClipNormal

Property
ClipNormal: vector

ClipNormal is the world-space normal of the custom clip plane; points satisfy dot(ClipNormal, p) + ClipOffset >= 0.

Default Vector3.new(0, 1, 0)

ClipOffset

Property
ClipOffset: number

ClipOffset is the world-space plane offset d in dot(ClipNormal, p) + d >= 0.

Default 0