Build a 2D Platformer
Everything you need to create a complete 2D platformer from scratch — movement, camera, advanced mechanics, health, collectibles, and transitions.
7 steps 8 scripts 1 kit beginner
The path
Add these in order. Each step builds on the one before it.
- Start: Basic 2D movement with coyote time and jump buffering PlayerController2D.cs · Complete 2D character controller with smooth movement, variable-height jumping, and coyote time.
- Add smooth camera follow with look-ahead CameraFollow2D.cs · Smooth camera follow with offset, dead zone, and look-ahead for 2D games.
- Add a health system with invincibility frames HealthSystem.cs · Reusable health component with damage, healing, invincibility frames, and events.
- Display health with an animated health bar HealthBarUI.cs · World-space or screen-space health bar with smooth fill, color gradient, and damage flash. Attach to enemies or use as HUD.
- Create collectible items with magnet pull Collectible.cs · Collectible item with bobbing animation, rotation, magnet pull, and event callbacks for coins, health, ammo, etc.
- Level up: wall jump, dash, and double jump PlatformerMechanics2D.cs · Wall jump, wall slide, dash, and double jump mechanics for 2D platformers. Drop-in extension for the 2D Player Controller.
- Polish: smooth transitions between levels ScreenFader.cs · Simple screen fade-in/fade-out with configurable color and duration. Great for scene transitions.
Kits for this path
Every script in this path
- 2D Player ControllerComplete 2D character controller with smooth movement, variable-height jumping, and coyote time.
- Smooth Camera Follow 2DSmooth camera follow with offset, dead zone, and look-ahead for 2D games.
- 2D Platformer MechanicsWall jump, wall slide, dash, and double jump mechanics for 2D platformers. Drop-in extension for the 2D Player Controller.
- Health SystemReusable health component with damage, healing, invincibility frames, and events.
- Pickup / CollectibleCollectible item with bobbing animation, rotation, magnet pull, and event callbacks for coins, health, ammo, etc.
- Screen FaderSimple screen fade-in/fade-out with configurable color and duration. Great for scene transitions.
- Health Bar UIWorld-space or screen-space health bar with smooth fill, color gradient, and damage flash. Attach to enemies or use as HUD.
- Damage PopupFloating damage numbers that animate upward and fade out. Supports critical hits, healing, and custom colors.