Nicholas Brown
Unity Developer
Control Room Camera Controller
While working at Atkins, I was placed on a project that I had to create a first and third person control system. The user had to be able to change between first and third person views, move around and change their height.
​
The movement was simple, manipulating a rigidbodies velocity, depending on what keys were being pressed. The first person camera controls the rotation of the neck in the x axis (looking up and down) which the camera is attached to, along with the body's y axis (left and right). While the user is in first person view the camera is simply parented to the neck at an offset.
​
When changing to the third person view the first person camera controller is kept active as it can still control all the relevant rotations. The third person camera controller (TPCC) unparents the camera from the neck and creates a virtual tracking point under it. Using the tracking point the TPCC tweens the camera to the tracking position and rotation; this creates a nice smooth movement. The TPCC controls the its distance from the user's avatar using a simple raycast in both directions limited to the current distance the camera is from the avatar updating the tracking position appropriately. I also created some simple functions to help set up the tracking position in the inspector.



