Skip to content

77 game-dev skills for AI coding agents — Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox. Portable SKILL.md Agent Skills (the format Anthropic launched as Claude Skills), with a router that loads the right skill for your engine and task. Runs in Claude Code, Cursor, Kiro, Codex, Copilot, Gemini CLI and more.

fix(camera-systems): screen_relative mouse look and Cinemachine 3.1 component names

Kiro Crewdea506a556d1
diff --git a/skills/disciplines/camera-systems/SKILL.md b/skills/disciplines/camera-systems/SKILL.md
index 42e5fe2..df9af28 100644
--- a/skills/disciplines/camera-systems/SKILL.md
+++ b/skills/disciplines/camera-systems/SKILL.md
@@ -99,9 +99,13 @@ func _camera_target(dt: float) -> Vector2:
```gdscript
# Godot 4.7. Yaw/pitch a pivot; a SpringArm3D auto-pulls the camera in when blocked.
func _unhandled_input(e):
- if e is InputEventMouseMotion:
- _yaw -= e.relative.x * sensitivity
- _pitch = clampf(_pitch - e.relative.y * sensitivity, -1.2, 0.4) # clamp pitch!
+ if e is InputEventMouseMotion and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
+ # screen_relative is unscaled; `relative` is scaled by the stretch settings, so
+ # sensitivity would change with window size. The docs recommend screen_relative
+ # for captured-mouse aiming.
+ _yaw -= e.screen_relative.x * sensitivity
+ _pitch = clampf(_pitch - e.screen_relative.y * sensitivity,
+ deg_to_rad(-80.0), deg_to_rad(45.0)) # clamp pitch!
func _process(_dt):
pivot.rotation = Vector3(_pitch, _yaw, 0)
# $SpringArm3D handles wall collision: set spring_length + collision_mask; the child
@@ -117,7 +121,9 @@ func _process(_dt):
var shake_offset := Vector2.ZERO # set each frame by game-feel (trauma^2 * noise)
func _apply(final_focus: Vector2) -> void:
global_position = final_focus + shake_offset # shake rides ON TOP of smooth follow
-# Unity Cinemachine: add a CinemachineBasicMultiChannelPerlin and set amplitude from trauma.
+# Unity Cinemachine 3: CinemachineBasicMultiChannelPerlin (AmplitudeGain/FrequencyGain) for
+# continuous noise driven by trauma; for one-off impacts, a CinemachineImpulseSource on the
+# hitter plus a CinemachineImpulseListener on the camera.
```
## Pitfalls
@@ -129,7 +135,10 @@ func _apply(final_focus: Vector2) -> void:
- **No bounds clamp** lets the camera show black past the level edge. Clamp focus to the level
rect (account for the viewport half-size so the *view*, not the center, stays inside).
- **No deadzone in twitchy games** makes the camera twitch with every micro-movement → nausea.
-- **Unclamped pitch** in third/first-person flips the camera over the top. Clamp pitch to ~±80°.
+- **Unclamped pitch** in third/first-person flips the camera over the top. Clamp pitch (about
+ -80° to +45° for an orbit, ±80° for first-person).
+- **Mouse-look sensitivity that changes with window size** (Godot): `InputEventMouseMotion.relative`
+ is scaled by the stretch settings; read `screen_relative` for captured-mouse aiming.
- **Camera clipping through walls** in 3D — use a spring arm / occlusion ray to pull in.
- **Snapping on teleport/respawn** is jarring; either hard-cut intentionally (and reset
smoothing) or fast-ease. Don't let a huge `SmoothDamp` distance whip across the level.
diff --git a/skills/disciplines/camera-systems/references/follow-and-framing.md b/skills/disciplines/camera-systems/references/follow-and-framing.md
index f10ad60..f848145 100644
--- a/skills/disciplines/camera-systems/references/follow-and-framing.md
+++ b/skills/disciplines/camera-systems/references/follow-and-framing.md
@@ -61,15 +61,16 @@ Tunables: deadzone `32–64 px`, look-ahead `40–120 px` eased over `0.2–0.4
- Yaw rotates the body (so movement aligns with view); pitch rotates only the camera head.
- Clamp pitch; never let roll accumulate.
-- Mouse: use relative motion + capture the cursor (`Input.mouse_mode = MOUSE_MODE_CAPTURED`).
+- Mouse: capture the cursor (`Input.mouse_mode = Input.MOUSE_MODE_CAPTURED`) and read
+ `InputEventMouseMotion.screen_relative`, which is not scaled by the stretch settings.
- Stick: apply a response curve + deadzone (see `input-systems`) and frame-rate-scaled turn rate.
## 5. Multi-target / group framing
- Compute the bounding box of all targets; place the camera at the box center.
- **2D:** set zoom so the box (plus padding) fits the viewport; clamp zoom min/max.
-- **3D:** dolly the camera back / adjust FOV to fit the box; Cinemachine has a Group Framing /
- Target Group component for this.
+- **3D:** dolly the camera back / adjust FOV to fit the box. In Cinemachine 3, point the camera's
+ Tracking Target at a `CinemachineTargetGroup` and add `CinemachineGroupFraming`.
- **Split-screen:** one camera per player rendering to a viewport rectangle; budget the extra
render cost (`performance-optimization`).
@@ -82,10 +83,18 @@ Tunables: deadzone `32–64 px`, look-ahead `40–120 px` eased over `0.2–0.4
## 7. Per-engine rig summary
+Unity column: Cinemachine 3.1 (3.1.7 is the current release, June 2026), namespace
+`Unity.Cinemachine`. The v2 components (`CinemachineVirtualCamera`, `CinemachineCollider`,
+`CinemachineFramingTransposer`) are marked deprecated in 3.x and point to `CinemachineCamera`,
+`CinemachineDeoccluder` and `CinemachinePositionComposer`; do not use them in new code.
+`CinemachineDeoccluder` keeps the target in line of sight; `CinemachineDecollider` only pulls the
+camera out of geometry it intersects.
+
| Need | Godot 4.7 | Unity 6.3 LTS |
|------|-----------|---------|
-| 2D follow + smoothing + limits | `Camera2D` (`position_smoothing_*`, `limit_*`, `drag_*`) | Cinemachine `CinemachineCamera` (2D) + Confiner2D |
-| 3D follow/orbit | pivot + `SpringArm3D` + `Camera3D` | `CinemachineCamera` + Orbital Follow + Deoccluder |
-| Shake | additive `offset` from `game-feel` | `CinemachineBasicMultiChannelPerlin` |
+| 2D follow + smoothing + limits | `Camera2D` (`position_smoothing_*`, `limit_*`, `drag_*`) | `CinemachineCamera` + `CinemachinePositionComposer` (Damping, Dead Zone, Lookahead) + `CinemachineConfiner2D` |
+| 3D follow/orbit | pivot + `SpringArm3D` + `Camera3D` | `CinemachineCamera` + `CinemachineOrbitalFollow` + `CinemachineDeoccluder` (or `CinemachineDecollider`) |
+| Shake | additive `offset` from `game-feel` | `CinemachineBasicMultiChannelPerlin` (noise); `CinemachineImpulseSource` + `CinemachineImpulseListener` (impacts) |
| Bounds | `limit_*` / manual clamp | `CinemachineConfiner2D/3D` |
+| Group framing | manual bounding box + zoom | `CinemachineTargetGroup` + `CinemachineGroupFraming` |
| Addon option | `PhantomCamera` (declarative 2D/3D rigs) | built-in Cinemachine |