Skills

Bevy Adapt 2d To 3d

Rewrite Bevy 2D actors and cameras into 3D meshes and Camera3d while keeping gameplay...

Install

npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-adapt-2d-to-3d -g -a claude-code -y
Category
Media
Updated
19d ago
License
LGPL-3.0
Context cost
Mediumabout 1,928 tokens
Runs scripts
No, instructions only

What it does

Rewrite Bevy 2D actors and cameras into 3D meshes and Camera3d while keeping gameplay components. Use when a Bevy 2D game should gain a perspective camera, mesh draw, and a planar velocity lifted onto XZ. Keywords: Camera2d, Camera3d, Sprite, Mesh3d, StandardMaterial, WishVelocity.

Bevy adapt 2D to 3D

When to use

Load this when a 2D design should gain a 3D camera and meshes. Keep gameplay components. Swap the camera and the drawable.

ECS shape

  • Cameras: Camera2d and Camera3d are already documented on bevy-camera-systems. An entity should not keep both as if they were one camera mode unless that skill says so.
  • Draw: Sprite is 2D. Meshes and StandardMaterial are 3D (bevy-3d-materials).
  • Features: the crate page separates 2d and 3d profiles. Enabling 3D does not delete 2D types.
  • Motion: bevy-character-movement stays the locomotion skill. A 3D velocity is still your component until a solver exists.

What changes

KeepReplace
Gameplay components on the actorSprite with Mesh3d and MeshMaterial3d
The camera entityCamera2d with Camera3d and a perspective Projection
Planar motion as dataVec2 velocity with a Vec3 wish on XZ

There is no conversion helper. A startup system rewrites the entities you already spawned. Physics solvers stay on the physics skills.

[dependencies]
bevy = "0.20"
use bevy::mesh::Meshable;

#[derive(Component)]
struct Actor;

#[derive(Component)]
struct PlanarVelocity(Vec2);

#[derive(Component)]
struct WishVelocity(Vec3);
Read the whole SKILL.md on GitHub

More in Media