2D Platformer Starter Kit

Complete 2D platformer foundation with movement, camera, advanced mechanics, health, collectibles, and transitions.

Setup
1. Import all scripts into your Unity project
2. Create a Player object with Rigidbody2D and BoxCollider2D
3. Attach PlayerController2D and PlatformerMechanics2D
4. Create GroundCheck and WallCheck child transforms
5. Set up camera with CameraFollow2D targeting the player
6. Add HealthSystem component to the player
7. Create collectible prefabs with the Collectible script
8. Add ScreenFader to a UI Canvas for level transitions

If something does not work
- The player never jumps: PlayerController2D checks the ground with Physics2D.OverlapCircle at the GroundCheck transform against Ground Layer. Put GroundCheck at the player's feet, put your platforms on a layer, and select that layer in Ground Layer; Nothing selected means the player is never grounded.
- Wall jump and wall slide never trigger: PlatformerMechanics2D uses its own WallCheck transform and Wall Layer. Place WallCheck at the side the player faces and select the layer your walls use (it can be the same as the ground layer).
- The scripts do not compile on Unity 2022.3: The controller and mechanics use Rigidbody2D.linearVelocity, which exists from Unity 6. On 2022.3, rename linearVelocity to velocity in both scripts, or use Unity 6.
- The sprite jitters while the camera follows: Set the player's Rigidbody2D Interpolate option to Interpolate, and keep the camera following in LateUpdate, as CameraFollow2D does. Do not also move the player's Transform from your own code.
- Every input call throws InvalidOperationException in a new Unity 6 project: The scripts read the legacy Input class, which new Unity 6 projects switch off. Set Project Settings > Player > Active Input Handling to Both and let the Editor restart. Details and the Input System alternative.

Source: https://scriptsforunity.com/game-systems/2d-platformer-kit/
License: MIT
