After many iterations of player controllers using Rigidbodies and CharacterControllers, this solution has been by-far my most elegant and simplistic. It mostly revolves around basic physics equations to be as realistic as possible.
- Download the latest unitypackage from the releases tab
- Open your Unity project
- Install the new Input System package from the Package Manager window
- Double-click on the unitypackage to import the package
- Import all
There is a Player prefab in CriticalAngle\Prefabs
that has everything set up already. I would recommend using that as a base and expanding from there.
The object's needed components are a Rigidbody, a Capsule Collider, and the CriticalAnglePlayer script. The script itself requires a reference to the camera, which is a child of the GameObject, and a ground mask. Any object that you want the player to walk on MUST have the same layer as the layer selected in the ground mask.