Character Controller in Unity

--

objective: demonstrate how to make a character controller in Unity.

As you can see I have a character that can move and jump. First create a player script and attach it to the capsule in the scene.

Declare the above.

Declare a controller and get the component.

If the controller is grounded then get the horizontal axis as a movement input. Set the direction to incorporate the new input. Now, if the space key is pressed then jump. Incorporate gravity and then the move method.

--

--