A Physics Based Character Controller for Unity — Part 1 Basic Movement

Character controller and script for the player

Player Inspector with added character controller and player script

Horizontal Movement

//get the horizontal movements
//get the direction based on input
//move in this direction
+

Velocity and Gravity

private float _gravity = 1.0f;
if(_controller.isGrounded == true)
{
//do nothing for now
}
else
{
velocity.y -= _gravity;
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrea Zilio

Andrea Zilio

Passionate Game Developer and Learning Expert. I love to create games and interactive experiences using Unity, Articulate, C#, JavaScript, PHP, HTML, CSS.