Skip to content

Camera ​

RenderingScripts: CameraComponent

From a script ​

ts
import { CameraComponent } from "mmpx";

const camera = this.entity.TryGetComponent(CameraComponent);

Full API: CameraComponent.

Fields ​

FieldTypeDefaultDescription
Projection
projection
"orthographic" | "perspective""orthographic"
Fit Canvas
fitCanvas
booleantrueFrame a Canvas: the ortho size follows its reference size and scale mode. Off = use Ortho Size (zoom).
Canvas
canvas
Canvas—Which Canvas to frame — empty = the scene's first Canvas
Ortho Size
orthographicSize
number (0.001 … ∞)540Half the visible height, in world units
Field Of View
fieldOfView
number (1 … 179) (°)60
Visibility
cullingMask
layer maskEverythingLayers this camera renders
Priority
depth
number0Higher renders later (on top)
Post Effects
postMaterials
list of material assets[]Post-domain materials applied to everything this camera draws, in order

Clear ​

FieldTypeDefaultDescription
Flags
clearFlags
"solid-color" | "depth-only" | "dont-clear""solid-color"
Color
clearColor
colour#000000
Alpha
clearAlpha
number (0 … 1)1

Viewport ​

FieldTypeDefaultDescription
Viewport X
viewportX
number (0 … 1)0Screen fractions from the top-left (screen space is y-down)
Viewport Y
viewportY
number (0 … 1)0
Viewport Width
viewportWidth
number (0 … 1)1
Viewport Height
viewportHeight
number (0 … 1)1
Clip
clipToViewport
booleantrue

Advanced ​

FieldTypeDefaultDescription
Near Clip
nearClip
number-1000
Far Clip
farClip
number1000
Target Texture
targetTexture
renderTexture asset—Draw into this render texture instead of the screen

© 2026 PlayAdGentic