# Bevy Camera Systems

Bevy ECS skill for cameras.

- Repository: https://github.com/thedivergentai/Game-Dev-Agentic-Skills (917 stars)
- Category: Engineering
- License: LGPL-3.0
- Last updated: 2026-10-16
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-camera-systems -g -a claude-code -y`
Codex: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-camera-systems -g -a codex -y`
Cursor: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-camera-systems -g -a cursor -y`
Gemini CLI: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-camera-systems -g -a gemini-cli -y`

## Description

Bevy ECS skill for cameras. Keywords: Bevy, Camera, Camera2d, Camera3d, Transform.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Bevy camera systems

## When to use

Load this when a view must render 2D or 3D. `Camera`, `Camera2d`, `Camera3d`, and the `two_passes` example are the sources for the names below. The library pin is 0.20.

## ECS shape

- **Components:** `Camera` is the viewpoint (projection and render target). A `Camera` with no render graph errors at runtime. `Camera2d` enables the 2D graph and requires `Camera`, `Projection`, and `Frustum`. `Camera3d` enables the main 3D graph and requires `Camera` and `Projection`. 3D space is right-handed: X right, Y up, Z back, so forward is -Z.
- **Spawn:** the example uses `commands.spawn((Camera3d::default(), Transform::from_xyz(...).looking_at(Vec3::ZERO, Vec3::Y)))`. A second camera sets `Camera { order: 1, clear_color: ClearColorConfig::None, ..default() }` so it draws on top without clearing.
- **Query:** systems may take `(&Camera, &GlobalTransform)` with `With<Camera2d>`. `Camera::viewport_to_world_2d` maps a viewport position to a 2D world position for an orthographic camera along Z.
- **Schedule:** spawn on `Startup`. Follow, split viewports, and trauma offset are your components on `Update`.

```rust
fn spawn_cameras(mut commands: Commands) {
    commands.spawn((
        Camera3d::default(),
        Transform::from_xyz(0.0, 6.0, 10.0).looking_at(Vec3::ZERO, Vec3::Y),
    ));
    commands.spawn((
        Camera2d,
        Camera {
            order: 1,
            clear_color: ClearColorConfig::None,
            ..default()
        },
    ));
}
```

```rust
#[derive(Component)]
struct FollowTarget;

#[derive(Component)]
struct FollowCam {
    offset: Vec3,
    stiffness: f32,
}

The rest: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/blob/HEAD/skills/bevy-camera-systems/SKILL.md
