This tutorial is designed to get you up and running with Unity as quickly as possible by showing you how to create a simple player controller system. This player controller and corresponding camera controller system can easily be applied to different types of game player objects such as first person, third person, physics based players, and different types of vehicles.
You may want to skip ahead to the steps and the code but first here is a bit of background behind this method.
Why this System
In learning how to use Unity I encountered some fairly major issues with other examples of basic player controllers.
Firstly I was interested in using physics based players. An example of this is the rolling ball in the Unity Roll a ball tutorial. Other physics based players can include things like flying or rolling vehicles. Physics based movement can be tricky to work with but it also lends itself well to physics based interactions with other physics based objects in the game environment.
However, the first thing that struck me with the Roll a ball example is that there is no fast method for the play to turn around, or to say ‘swivel’, and to then easily move forward and backwards etc in different directions. I also discovered that even if I could get the player to swivel I couldn’t simply parent the camera to the player object in order to face the new direction because if the player object was rolling the camera would inevitably roll with it.
Another reason why I wanted to investigate a relatively simpler method for player movement is because I am interested in developing player controls that can be more easily translated to working with mobile devices that do not normally have a mouse input option. My idea here is that I could create simple UI buttons that could be tapped on mobile devices to control the movement, similar to say the mobile / joystick control systems that you can find in the Unity Asset Store and Youtube.
* Please note, if you are after the more traditional mouse pointer lock style controls that are most commonly used in FPS (first person shooter) games then this system is not for you. In this case you would be much better off following a tutorial like Brackeys’ – First Person Movement.
How This System Works
This system works by creating another ‘Camera Target’ object that is scripted to align with the player’s x, y, z position, but not rotation. The camera is then parented to that object. Controls are then applied to swivel or turn that object which creates the effect of the camera orbiting around that object to face different directions. Physical forces are then applied to player object based on the direction that the camera target object is facing. This is handy in situations where the camera maybe angled differently, so the force is not necessarily applied in the direction that the camera is facing but in the direction that the camera target is facing.
Advantages of This System
The advantage of this system is that you can adjust the position of the camera to either look at your player as in a third person game or be in the position of your player as in a first person game. And, if your player is rotating or spinning around due to rolling or collisions etc this does not necessarily affect the rotation of camera. For a first person controller you can simply turn off the mesh rendering of your player object, in which case the rigid body (or say physical shape) of your player can still interact with the physical environment.
Part 1 – Create a Plane
- You should probably start with a new Unity project and call it something like ‘Simple Game Development’ (or similar).
- Go to the Game Object main menu and select 3D Object – plane.
- With the plane object selected in the Inspector set the scale to 5,5,5. (The position should be 0,0,0). * Because it is a plane object the ‘y’ value doesn’t really do anything, I just change it for the sake of keeping all the values consistent).
- Download the checkerboard image and import it into your project assets. Either:
- Drag the file from your computer/desktop directly into the assets panel in Unity, or
- Right click in the assets panel and select ‘Import File’.
- Drag your checkerboard image from your assets panel onto your plane object.

Part 2 – Create a Sphere / Player Object
- Go to the Game Object main menu and select 3D Object – Sphere.
- With the sphere selected use the vertical arrow to lift the sphere above the plane, eg: x=0. y=3, z=0. (*you could also set the y value in the inspector)
- Drag your checkerboard image from your assets panel onto your sphere object.
- With sphere selected, in inspector Add Component – Rigid Body
- Press Play and sphere should drop. *Then don’t forget to deselect Play.
- In the hierarchy rename your sphere object to ‘Player’.

Part 3 – Create Bouncy Material
- In your assets, right click – Create – Physics Material. Call in ‘Bouncy’. Set the Bounciness to .8.
- Select your sphere object and drag your physics material either:
- Into the field in the inspector called ‘Material’.
- Onto the sphere object.
- Onto the inspector panel at the bottom.
- Play your game and the ball should bounce.

Part 4 – Add a Camera Target Object
Now we are going to add an object that we are going to parent the camera to. When this object is rotated the camera will rotate around that point.
- Add a 3cube object
- Set the Scale to .25,. 25, .25.
- Set the Position to 0, 0.5, 0.
- In the Hierarchy rename this cube to ‘Camera Target’.
- Select the camera and use the arrows, while looking at the camera view to position the camera how you want it to look at the player. For a fairly standard view you might want to try a position like 0, .5, -3.
- In the Hierarchy drag the Main Camera object on the ‘Camera Parent’ object to make it a child of the Camera Parent object.
- We don’t want this object to collide with anything so in the Inspector uncheck the checkbox for ‘Box Collider’.
- * Eventually we will most likely want to make this object invisible by unchecking the box for ‘Mesh Renderer’ but for now it doesn’t hurt to have it visible.
Part 5 – Add Camera Controls
- With the Camera Target object selected at the bottom of the inspector click the button to ‘Add Component’, and select New Script, and name it: ‘CameraController’.
- Add the following code, making sure the class name matches the name of the script.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraController : MonoBehaviour
{
public GameObject player;
/*
You will need to set the player object in Unity.
The object that has this script attached to it, ie the 'Camera Target' object
will then align itself with whatever object is set as the 'Player'
*/
void Update()
{
// Align to player position
transform.position = player.transform.position;
// Rotate left
if (Input.GetKey(KeyCode.A))
{
transform.Rotate(new Vector3(0, -1, 0) * Time.deltaTime * 100, Space.World);
}
// Rotate right
if (Input.GetKey(KeyCode.D))
{
transform.Rotate(new Vector3(0, 1, 0) * Time.deltaTime * 100, Space.World);
}
}
}
- Then with your Camera Target object selected in the Inspector drag the player in the target field.
- Now test your game and the camera should orbit around the camera parent object.

Part 6 – Add Player Controls
Add a new script to the Player object called ‘BasicPlayerController’:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BasicPlayerController : MonoBehaviour
{
/*
Create a variable called 'rb' that will represent the
rigid body of this object.
*/
private Rigidbody rb;
// Create a public variable for the cameraTarget object
public GameObject cameraTarget;
/*
You will need to set the cameraTarget object in Unity.
The direction this object is facing will be used to determine
the direction of forces we will apply to our player.
*/
public float movementIntensity;
/*
Creates a public variable that will be used to set
the movement intensity (from within Unity)
*/
void Start()
{
// make our rb variable equal the rigid body component
rb = GetComponent<Rigidbody>();
}
void Update()
{
/*
Establish some directions
based on the cameraTarget object's orientation
*/
var ForwardDirection = cameraTarget.transform.forward;
var RightDirection = cameraTarget.transform.right;
// Move Forwards
if (Input.GetKey(KeyCode.W))
{
rb.AddForce (ForwardDirection * movementIntensity);
/* You may want to try using velocity rather than force.
This allows for a more responsive control of the movement
possibly better suited to first person controls, eg: */
//rb.velocity = ForwardDirection * movementIntensity;
}
// Move Backwards
if (Input.GetKey(KeyCode.S))
{
// Adding a negative to the direction reverses it
rb.AddForce (-ForwardDirection * movementIntensity);
}
// Move Rightwards (eg Strafe. *We are using A & D to swivel)
if (Input.GetKey(KeyCode.E))
{
rb.AddForce (RightDirection * movementIntensity);
}
// Move Leftwards
if (Input.GetKey(KeyCode.Q))
{
rb.AddForce (-RightDirection * movementIntensity);
}
}
}
- Play your game and you should be able to control your player and swivel the camera.
- If you haven’t already, you may want to uncheck the mesh renderer for the camera parent object.

Next Steps
If you haven’t already you might want to trying swapping the force based movement with velocity, as included in the code comments. This is much more responsive than the force based controls.
You may also want to experiment with repositioning the camera and turning the mesh rendering of the player object off to create a really simple first person controller.
A really good thing to do is to add a range of basic 3D objects with rigid bodies that your player can interact with.
You could also see if you can add a vertical lift movement to the controller that could be used for something like a drone, space, or underwater vehicle.
In the next tutorial in this series you will learn how you can extend this basic player controller by adding the ability to jump and move the player only when it is grounded. You’ll also learn how to create a simple projectile system, to shoot stuff. 🙂
If you would like to stay in the loop when I publish new content your best bet is to join my mailing list, as I don't tend to post my tutorials and articles to social media. Otherwise you can always follow my work on Youtube, Twitter, Instagram, Reddit, Artstation, LinkedIn, and Behance.
If you're into game development you may also be interested in my game design and development articles.