Provides more precise and snappier controls for a platformer game than the default Unity character controller.
The repository contains all required assets for a demo scene to demonstrate the controller. The important files are in the Assets/Scripts/
folder.
- Raycast based collision detection
- Wall jumping and wall sliding
- Support for one-way platforms with the ability to drop through
- Reactive jump: Jump input is still recognized right before and after being grounded or after touching a wall
- Ability to control jump height by releasing the jump button mid jump
- Slopes
- Moving platforms
- Add the
MovementController.cs
andPlayer.cs
scripts to your player game object. - Make sure the player has a Box Collider 2D attached to it.
- Set up the collision masks inside the inspector.
- Start tweaking the parameters!
- Attach Edge Collider 2D to the platform game object.
- Tag the platform as
Platform
.
Pressing "Down" on a platform will make the player fall through it.