Creating a Physics Based Character Controller from Scratch in Unity

Physics Based Character Controller part 1

In the Editor

In the Player Script

private CharacterController _controller;
private float _speed = 3f;
void Start()
_controller = GetComponent<CharacterController>();
if (_controller == null) { Debug.LogError(“player.charactercontroller is null”); }
void Update()
//get horizontal input = direction
Vector3 direction = new Vector3(Input.GetAxis(“Horizontal”), 0);
//velocity = direction with speed
Vector3 velocity = direction * _speed;
//move player with velocity
_controller.Move(velocity * Time.deltaTime);



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
Tristan Engel

Aspiring developer that’s self-learning Unity & C# to transition to a career with Unity. I got a passion for creating interactive experiences.