<!-- Page: https://rustic-game-engine.pages.dev/docs/api/camera-actions -->

# Camera actions

Move, aim, zoom, follow and shake a game camera using shared actions.

[Feature status and language/platform compatibility](https://rustic-game-engine.pages.dev/markdown/reference/compatibility.md)

Choose an API to see its signature, parameters, examples and behavior.

## APIs

- [Camera.current()](https://rustic-game-engine.pages.dev/markdown/api/camera-actions/current.md)
- [Camera.moveTo()](https://rustic-game-engine.pages.dev/markdown/api/camera-actions/move-to.md)
- [Camera.zoom()](https://rustic-game-engine.pages.dev/markdown/api/camera-actions/zoom.md)
- [Camera.fov()](https://rustic-game-engine.pages.dev/markdown/api/camera-actions/fov.md)
- [Camera.lookAt()](https://rustic-game-engine.pages.dev/markdown/api/camera-actions/look-at.md)
- [Camera.follow()](https://rustic-game-engine.pages.dev/markdown/api/camera-actions/follow.md)
- [Camera.orbit()](https://rustic-game-engine.pages.dev/markdown/api/camera-actions/orbit.md)
- [Camera.shake()](https://rustic-game-engine.pages.dev/markdown/api/camera-actions/shake.md)
- [Camera.transition()](https://rustic-game-engine.pages.dev/markdown/api/camera-actions/transition.md)

## Module guide

## Setup and language support

These engine-owned services work in Lua 5.4, Luau, JavaScript, Python, C, C++, C#, Java, PHP, and HTML inline JavaScript. Follow [Use gameplay actions](https://rustic-game-engine.pages.dev/markdown/guides/gameplay-actions.md) to create and attach a script, install external toolchains, and choose the correct language binding. PHP and HTML scripts belong under `ui/`; CSS alone runs no gameplay code.

The Calls section uses JavaScript signatures. The function examples below include native syntax for all ten script types, including SDK-specific alternatives and limitations. Attach a JavaScript Object Component script to the specified target and press **Play**. Globals are supplied by the engine. Schedule actions from `Start` or a callback, rather than at script top level. Native languages use typed options and their own builder conventions; see the guide's language bindings.

## Parameters

Camera is a stable camera ID or scene path. Position/center/offset are local vectors; rotation is [x, y, z, w]. Fov is finite radians between zero and pi on a perspective camera. Duration is finite non-negative seconds; easing defaults to Linear.

## Return and timing

Current returns the active camera ID where supported; actions return operation handles. Transition animates position, rotation and FOV in parallel. Select a viewpoint with [Game.setCurrentCamera](https://rustic-game-engine.pages.dev/markdown/api/camera.md).

## Behavior and limitations

- Create/select an active perspective camera before Play. It reaches the given position, identity rotation and 45-degree FOV in two seconds.
- Lua/Luau/JavaScript additionally allow moveTo(position, duration, easing) and zoom(fov, duration, easing) for the current camera. Explicit targets work across all bindings.
- Camera.current is available in every gameplay language, including C; it returns the active camera ID.
- LookAt samples when starting; follow re-reads its target only during the finite duration. Orbit uses local XZ. Shake restores its initial position.
- Check script attachment, enabled state and the Console when an operation fails. Asynchronous errors also appear in operation state. Callback exceptions disable the owner and clean up its actions.
- Owner destruction, disable, successful reload or Stop cleans up owned actions and subscriptions. Failed reload retains the previous behavior's operations. See [Operation handles](https://rustic-game-engine.pages.dev/markdown/api/operation-handles.md) for controls and lifetime details.
