Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Godot Camera?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tipoli5890-godot-camera)
---
name: godot-camera
description: >-
Godot cameras: Camera2D follow, limits and smoothing, Camera3D third and first person on a
SpringArm3D, shake; jitter and clipping.
---
# godot-camera — the follow, and the jitter
Most camera jitter is a camera and a body updated on different ticks.
## Situation → where to read
| Situation | Read |
|---|---|
| "The player shakes on screen", "the world stutters", "smooth at 60 Hz, jittery at 144" | *Jitter in one screen* below, then `reference/jitter.md` |
| A 2D follow camera: smoothing, look-ahead, limits from a room or a tile layer, zoom, drag margins | `reference/camera-2d.md`, `resources/follow_camera_2d.gd` |
| A third-person camera: orbit, pitch limits, walls in the way, moving relative to the camera | `reference/camera-3d.md`, `resources/orbit_camera_3d.gd` |
| First person; switching cameras; cut-scenes | `reference/camera-3d.md` → "First person" and "Which camera is current" |
| The camera snaps into the character's head or behind a wall | *Clipping* below |
| Shake on hits and landings | *Shake* below, `resources/camera_shake.gd` |
| Pixel-art cameras: snapping, integer zoom | `godot-2d-rendering` |
| A scene to lint for the known traps | `scripts/camera_check.py` |
## Jitter in one screen
A body moved in `_physics_process` changes position only on physics ticks. At a frame rate above
the tick rate (144 Hz against 60) some frames hold no tick, so its per-frame motion is uneven:
`10, 0, 0, 10, 0, 10, 0, 0` pixels at 600 px/s. What the player sees as jitter is **the target's
offset from the camera centre changing direction** from frame to frame. Headless at
`--fixed-fps 144`, over 60 frames of steady running with interpolation off:
| Set-up | Offset reversals |
|---|---|
| `Camera2D` child of the body, `position_smoothing_enabled`, default `process_callback` (idle) | about 50 |
| the same with `process_callback = CAMERA2D_PROCESS_PHYSICS` | 0 |
| `follow_camera_2d.gd` with smoothing and look-ahead (physics tick, after the motors) | 0 |
So the first rule: **the camera updates on the tick the target moves.** That removes the
character shaking against the screen. What remains is the whole view stepping on ticks, which
physics interpolation removes (`physics/common/physics_interpolation`, or
`SceneTree.physics_interpolation` at runtime):
- **2D**: with interpolation on, `Camera2D.get_screen_center_position` moves in equal steps every
frame (4.17 px at 144 fps for a 600 px/s body, against `10, 0, 0, 10` without). A `Camera2D`
left on the idle callback is run on the physics tick anyway, and the engine prints
`WARNING: Camera2D overridden to physics process mode due to use of physics interpolation.` when
it enters the tree: set `process_callback = 0` in the scene (a script sets it in `_init`, before
the node enters). The bodies themselves are interpolated in the renderer
(`RenderingServer.canvas_item_set_interpolated`), which a headless run cannot see.
- **3D**: read the target's `Node3D.get_global_transform_interpolated` in `_process` and switch
the camera rig's own interpolation off. Headless at 144 fps this gives equal steps of 0.0417 m
per frame for a 6 m/s body; the plain `global_position` gives `0, 0.1, 0, 0.1 ...`.
`orbit_camera_3d.gd` does this.
- After any teleport: `Node.reset_physics_interpolation` (and `Camera2D.reset_smoothing`), or the
camera glides across the level. Both scripts' `snap()` do it.
Other causes, how to tell them apart headless, and a sampler to drop into a journey:
`reference/jitter.md`.
## The 2D follow
`resources/follow_camera_2d.gd` extends `Camera2D` and follows `target_path` from anywhere in the
tree (the player can be freed or respawned without taking the camera). It sets
`process_callback` to physics and `process_physics_priority = 10`, so it aims after motors at
priority 0 in the same tick, adds a capped look-ahead along the target's `velocity`
(`linear_velocity` for a `RigidBody2D`), and offers `snap()`, `fit_limits(rect)` and
`fit_limits_to_layer(tile_layer)`.
Limits clamp the **centre** to `limit - visible size / zoom / 2`: with `limit_right = 1000` the
centre stops at `1000 - 64 / 1 / 2 = 968` in the 64-pixel headless viewport, 984 at zoom 2. A
headless run's viewport is not the project's window size, so a test computes the expected centre
from `get_viewport_rect().size`, never from `display/window/size/*`. More: `reference/camera-2d.md`.
## The 3D orbit
`resources/orbit_camera_3d.gd` is the pivot: it follows the target's interpolated position plus
`pivot_height`, holds `yaw` and `pitch` (clamped by `min_pitch_degrees` and `max_pitch_degrees`),
and builds `SpringArm3D` → `Camera3D` under itself if they are missing. Feed `apply_look()` with
the reader's `look` (`godot-input`) or a stick times delta; `move_direction(stick)` turns a stick
vector into a flat world direction relative to the camera's yaw, for the motor
(`godot-3d-controller`).
## Clipping
The arm casts a sphere (`probe_radius`, default 0.2 m) along its +Z and puts the camera at the
first hit minus the radius and the arm's `margin`. Headless, case by case:
| Case | Arm length (spring 4 m) |
|---|---|
| open space | 4.0 |
| a wall face at 2.4 m, sphere 0.2, margin 0.01 | 2.19 |
| the same wall with a ray (no shape) | 2.39 |
| the wall's layer not in the arm's `collision_mask` | 4.0 — the camera goes through it |
| the camera pitched low, so the cast passes through the player's own capsule | **0.30** — the camera lands in the character |
| the same, the body excluded with `SpringArm3D.add_excluded_object` | 4.0 |
| a cast that starts inside the player's shape (pivot inside the capsule) | 4.0 — not hit |
So: the arm's mask holds the level's layers and not the player's, or the rig excludes the body
(`exclude_target`, on by default, does `add_excluded_object(target.get_rid())`). A sphere keeps a
radius of clearance; keep `probe_radius` above the camera's `near` (0.05 by default) so the near
plane stays out of the wall (how the frame looks there needs a windowed run to confirm).
## Shake
`resources/camera_shake.gd` is a `Node` under a `Camera2D` or `Camera3D`. `add_trauma(amount)`
adds to a trauma value clamped to 1, which falls by `decay` per second; the offset is
`max_offset × trauma² × noise`, added to the camera's own `offset` (`h_offset`/`v_offset` in 3D)
and never to its position, so the follow and the limits are untouched. At trauma 0 the camera's
offset is exactly what it was before. The selftest checks the clamp, the bound
`|offset| ≤ max_offset × trauma²` on every frame, the linear decay (1.0 → 0.4 after 0.4 s at
decay 1.5) and the restore in 2D and 3D.
## Check it
```bash
python3 scripts/camera_check.py /path/to/project # WARN and NOTE lines, exit 0
python3 scripts/camera_check.py /path/to/project --strict # warnings fail (exit 2)
python3 scripts/camera_check.py --selftest # the resources, headless
```
The lint reads scenes as text: `idle-smoothing` (a smoothed `Camera2D` on the idle tick under a
physics body, interpolation off), `idle-with-interpolation` (a `Camera2D` on the idle tick with
interpolation on: the engine's WARNING above) and `arm-on-body` (a `SpringArm3D` under a body with
no script to exclude it). The selftest runs the three resources in a temp project: the follow
after N ticks, the jitter table above, look-ahead, limits from a rectangle and a `TileMapLayer`,
`snap()`, the clipping table, pitch clamping and `move_direction`, the shake, the 2D and 3D
follow with interpolation on and off, and the engine's WARNING for an idle camera.
## Discipline
- **Camera on the target's tick, or reading the target's interpolated transform.** Never smooth on
the idle tick toward a body that moves on the physics tick.
- **One camera script per view.** A follow script, a shake and a cut-scene each own a different
property (position, offset, current); two scripts writing `position` is the 3D equivalent of two
motors.
- **Teleports call `snap()`.** A respawn without it is a camera flying across the level.
- **Test from numbers.** Positions, limits and arm lengths are checked headless; the look of the
frame is checked in a windowed run, and said to be.
- **Every change ends with `godot-verify`.**
## Related skills
- Look input, mouse capture, sensitivity: `godot-input`
- Pixel-art look, snapping, draw order: `godot-2d-rendering`
- The bodies the camera follows: `godot-2d-controller` · `godot-3d-controller`
- Layers and masks of the arm's cast: `godot-physics`
- Journeys that sample the camera: `godot-play-harness`