Camera System
Use when implementing cameras, smooth follow, screen shake, camera zones, and...
Install
npx skills add jame581/GodotPrompter --skill camera-system -g -a claude-code -y- Repository
- jame581/GodotPrompter914
- Category
- Media
- Updated
- 3d ago
- License
- MIT
- Context cost
- Mediumabout 2,799 tokens
- Runs scripts
- No, instructions only
What it does
Use when implementing cameras, smooth follow, screen shake, camera zones, and transitions for 2D and 3D
Camera Systems in Godot 4.3+
All examples target Godot 4.3+ with no deprecated APIs. GDScript is shown first, then C#.
Related skills: player-controller for first-person camera setup, state-machine for camera state transitions, godot-optimization for camera culling and performance, physics-system for physics interpolation and camera smoothing, 2d-essentials for canvas layers, parallax scrolling, and coordinate conversion, math-essentials for smoothstep and lerp-based interpolation, tween-animation for camera shake and cinematic transitions, phantom-camera for a Cinemachine-style camera addon.
1. Camera2D Basics
Key Properties
| Property | Type | Description |
|---|---|---|
position_smoothing_enabled | bool | Enables built-in position smoothing (lerp toward target) |
position_smoothing_speed | float | Speed of built-in smoothing (default 5.0) |
drag_horizontal_enabled | bool | Enables a horizontal drag zone; camera only moves when target exits zone |
drag_vertical_enabled | bool | Enables a vertical drag zone |
limit_left | int | Left pixel boundary, camera will not scroll past this |
limit_right | int | Right pixel boundary |
limit_top | int | Top pixel boundary |
limit_bottom | int | Bottom pixel boundary |
zoom | Vector2 | Zoom level; Vector2(2, 2) = 2× zoom in, Vector2(0.5, 0.5) = zoom out |
Set limits to match your tilemap or level bounds so the camera never shows outside the world. Limits are in world pixels, not tiles.
2. Smooth Follow
A manual follow camera gives more control than the built-in smoothing, you can add look-ahead, offset, and custom easing.
GDScript
extends Camera2D
## Target node to follow (assign in Inspector or via code)
@export var target: Node2D
## How quickly the camera catches up to the target (higher = snappier)
@export var follow_speed: float = 8.0


