
dashStagger: Duration of the stagger the character suffers after dashing, a value of 0 will make dashes have no stagger and keep all momentum. dashSpeed: The speed in which the character dashes. dashDistance: Maximum distance traveled during the dash. jumpCancelStagger: If enabled, jumping will cancel the stagger time after the dash, allowing it to keep the momentum. canJumpDuringDash: If enabled, the character will be able to jump during of the dash. dashDownSlopes: If enabled, the character will dash down slopes (like in Mega Man X games), otherwise it will maintain it's height when encountering a down slope. omnidirectionalDash: If enabled, the character will be able to dash in any direction, otherwise only horizontal dashes are allowed. canDash: If enabled, the character will be able to dash. wallJumpSpeed: Horizonal speed added to the character when jumping from walls. canWallJump: If enabled, the character will be able to jump from walls. wallSlideSpeed: Speed in which the character will slide down walls if sliding is enabled. canWallSlide: If enabled, the character will be able to slide down walls. airDecelerationTime: Same as decelerationTime, but only applies if advancedAirControl is enabled and the character is not on the ground. A higher value will make it harder to turn while in the air and will require the player to start running on the ground before being able to make long jumps airAccelerationTime: Same as accelerationTime, but only applies if advancedAirControl is enabled and the character is not on the ground. If disabled, will use the default acceleration and deceleration times for air control advancedAirControl: If enabled, will allow you to set values for acceleration and deceleration while in the air, making it possible to have more stiff (or otherwise) controls while airborne. minJumpHeight: How high (in units) the character will keep jumping after releasing the jump button, ending the jump earlier. maxJumpHeight: How high (in units) the character can jump while holding the jump button.
ma圎xtraJumps: How many times an character can jump again without touching the ground. canUseSlopes: If your game doesn't have slopes, you can disable this option so the character never checks or adjusts for slopes, saving some performance. A value of 0 will allow the character to stop instantly decelerationTime: How much time (in seconds) an character will take to stop completely from maximum speed. A value of 0 will allow the character to reach maximum speed instantly accelerationTime: How much time (in seconds) an character will take to reach maximum horizontal speed. maxSpeed: The maximum horizontal speed the character can reach. The main classes used in this project are the CharacterData, used mainly for attributes and other adjustable values, and the CharacterController2D, which handles all the movement and collision algorithms. The base classes of this project can work Unity 2017.1 or higher, but 2019.4 or higher is recommended. Throwable objects can become stuck to walls if inside them when released. I'd stick to using only climbable angles (configurable) to avoid problems.
Slopes are still not perfect, specially "slide-only" angles.Fixed animation errors and added sprite example, art by rvros.
This approach makes use of raycasts and manual calculations to deal with movement and collisions of an character in the 2D platformer world in a simple way, while also allowing you to easily change values to tweak how it behaves. Sometimes, however, you might want a more precise and controlled input and movement, rather than a realistic one. The Unity engine offers very complete 2D physics features that allow you to create realistic platformer mechanics easily. There are some different of ways of implementing character movement and controls for 2D platformers, each with its own pros and cons.
2D platformers are one of the first and most widely used game genres, dating back to 1980 and having been adapted and combined with various mechanics and clever twists throughout a large number of titles since then.