Skip to content
ASArcaneMP Scripting APIScripting reference
Global objectClient APIGenerated

Camera

const Camera: object

Defined in: client/api.d.ts:2072

Local cinematic camera control for client resources.

readonly active: boolean

Whether the custom camera owns the current view target.

readonly lens: CameraLens

Current custom-camera lens settings.

readonly paused: boolean

Whether camera motion is paused.

readonly playing: boolean

Whether a tween, path, or orbit is running.

readonly pose: CameraPose

Current custom-camera pose.

readonly state: CameraState

Complete immutable state snapshot.

activate(view, transition?): boolean

Activates a fixed custom camera.

CameraView

CameraTransition

boolean

addLensEffect(classPath): boolean

Adds a camera lens-effect class.

string

boolean

addModifier(classPath): boolean

Adds a camera-modifier class.

string

boolean

animateTo(view, options?): boolean

Animates the active camera to a view.

CameraView

CameraAnimationOptions

boolean

capture(): CameraView | null

Captures the live game camera as a reusable view, or null while no camera manager exists.

CameraView | null

clearLensEffects(): boolean

Clears all camera lens effects.

boolean

clearLookAt(): void

Stops look-at control without stopping other motion.

void

fade(options): boolean

Starts a camera fade.

CameraFadeOptions

boolean

getBroomCrosshair(): boolean

Whether setBroomCrosshair is on; false by default.

boolean

getBroomFreeLook(): boolean

Whether setBroomFreeLook is on; false by default.

boolean

getDistanceScale(): number

The factor setDistanceScale last kept; 1 by default.

number

getFirstPerson(): boolean

Whether setFirstPerson is on; false by default.

boolean

getFovOffset(): number

The offset setFovOffset last kept; 0 by default.

number

getLookInput(): CameraLookInput

Mouse look since the previous call, in degrees, then clears it. Gathered only while the custom camera is active and neither the cursor nor a game menu owns the mouse; zero otherwise. The game’s own camera stops reading the mouse while a custom camera owns the view, so read this to steer it.

CameraLookInput

getPostProcess(key): CameraPostProcessState | null

A layer as it stands, or null.

string

Stable key, at most 128 characters.

CameraPostProcessState | null

getViewDistanceScale(): number

The factor setViewDistanceScale last kept; 1 by default.

number

lookAt(target, track?): boolean

Aims the active camera at a world position.

Vec3

boolean

boolean

orbit(target, options?): boolean

Starts an automated orbit around a world position.

Vec3

CameraOrbitOptions

boolean

pause(): void

Pauses camera motion.

void

playAnimation(assetPath, options?): boolean

Plays a cooked CameraAnim asset.

string

CameraAssetAnimationOptions

boolean

playPath(keyframes, options?): boolean

Plays a keyframed camera path.

CameraKeyframe[]

CameraPathOptions

boolean

playShake(classPath, options?): boolean

Starts a cooked CameraShake class.

string

CameraShakeOptions

boolean

postProcessKeys(): string[]

Keys of this resource’s layers.

string[]

postProcessPresets(): string[]

The photo-mode filters a layer’s preset can name.

string[]

postProcessSettings(): string[]

Every setting a layer can set, by its Unreal name.

string[]

removeAllPostProcess(): number

Removes every layer this resource set, at once.

number

How many there were.

removePostProcess(key, fade?): boolean

Removes a layer.

string

Stable key, at most 128 characters.

number

Seconds to blend out first. Default 0.

boolean

false when no layer has the key

restore(transition?): void

Returns control to the player camera.

CameraTransition

void

resume(): void

Resumes camera motion.

void

screenToRay(x, y): { dir: Vector3; origin: Vector3; } | null

The world ray through a point of the view, given as worldToScreen’s fractions: an origin just in front of the camera and a unit direction. Null without a view.

number

number

{ dir: Vector3; origin: Vector3; } | null

setBroomCrosshair(shown): boolean

Draws a crosshair at the centre of the view while the local player rides a broom, where a spell cast along the view goes; the game shows no reticle in flight. While it shows, the camera steps right over the rider’s shoulder, as the on-foot camera sits, so the rider is not under it. It hides with the game’s HUD, behind a game menu and while a custom camera owns the view. Off by default. Returns the setting kept.

boolean

boolean

setBroomFreeLook(enabled): boolean

Frees the game camera’s pitch while the local player rides a broom: the mouse and right stick look up and down, and the camera stays there instead of following the broom’s own pitch, so a spell cast along the view can be aimed above or below. The broom still climbs and dives on its own keys; on a gamepad those are the right stick’s, so climbing tilts the view too. Off by default; turning it off or dismounting hands the pitch back. Returns the setting kept.

boolean

boolean

setDistanceScale(scale): number

Moves the game’s own third-person camera back (above 1) or in (below 1) from the local player, as a factor on its usual distance, held to 0.5-4; returns the factor kept. Walls still pull it in, and aiming, combat and mounts keep their own distance. An animal form multiplies in its own factor for its size. 1 restores it.

number

number

setFirstPerson(enabled): boolean

Shows the game’s own camera from the local player’s eyes. The view sits on the eyes and turns about them as a head does, eased so the run cycle does not shake it, and pitches 85 degrees up and down. It is still the game’s camera, so look, aim mode and a broom ride work as before. The player’s own head and hair are hidden for them alone and still cast their shadow; a hood or hat loses the part on the head. A custom camera shows them again. The game has no first-person animations, so the body still turns toward where it walks. Off by default. Returns the setting kept.

boolean

boolean

setFovOffset(degrees): number

Widens (above 0) or narrows (below 0) the game’s own camera by this many degrees, on top of the player’s Field of View option, held to -30..60; returns the offset kept. The player’s saved option is not changed, and the game’s own zooms (aiming, sprinting) still play around it. 0 restores it. A custom camera has its own lens: see setLens.

number

number

setLens(lens): boolean

Updates selected lens fields on the active camera.

CameraLensOptions

boolean

setPose(pose): boolean

Moves the active custom camera immediately.

CameraPose

boolean

setPostProcess(key, layer): boolean

Creates or replaces a post-process layer on this client’s view. It shows from the next frame and comes back by itself after a level change. Keys belong to the calling resource, and its layers go when it stops. Throws a TypeError on an unknown setting or a value its type can’t take, and an Error at 64 layers.

string

Stable key, at most 128 characters.

CameraPostProcess

boolean

true

setViewDistanceScale(scale): number

Scales how far the world draws for the local player, as a factor on their own View Distance quality, held to 0.25-4; returns the factor kept. It moves the distance at which objects swap detail level or stop drawing; it loads no more of the world. 1 restores it.

number

number

stop(): void

Stops camera motion while keeping the current view.

void

stopAnimations(immediate?): boolean

Stops all CameraAnim instances.

boolean

boolean

stopFade(): boolean

Stops the active camera fade.

boolean

stopShakes(immediate?): boolean

Stops all camera shakes.

boolean

boolean

updatePostProcess(key, changes): boolean

Changes some of a layer’s fields; settings merge one by one, and null drops one. Throws like setPostProcess.

string

Stable key, at most 128 characters.

CameraPostProcess

boolean

false when no layer has the key

worldToScreen(point): { x: number; y: number; } | null

Where a world point lands in the view the player sees, as fractions of it from the top-left (0..1): scale by a page’s innerWidth and innerHeight to pin an element there. Null when the point is behind the camera or outside the view. Read it every frame for a moving point.

Vector3

{ x: number; y: number; } | null