Press to play gameView on GitHub

The 'Complete Character Controller' is a package I created for the Unity Asset store. It was designed to be a one stop shop for getting all types of character movement for a game no matter the style. It supports many complex movement systems such as :


Walking

Sprinting

Crouching

Jumping

Slopes

Stairs

Moving platforms

6 degrees of freedom movement (Ability to walk on walls)

Planetary gravity system

Works for first and third person game types

Support for root motion based movement

Video Showcase

Code snippets

The main update and fixed update loop calls all the relevant functions for the controller to work.

The Move() function is in Fixed update as it moves the physics body. Doing it this way is more accurate.

Break

The next step is too check if the player is grounded. This does many things such as calculating the new direction for the players gravity to be pointing, weather they are on a slope, if planetary gravity is enabled among other things

Break

After checking the ground and making its calculations the player is then rotated to the correct orientation. This is both for the generic movement and 6 DOF movements.

Break

The controller has an advanced footstep system as well. It checks the tag of the object that it is stepping on and then plays a random sound from a list.

Break