[DEV] Player & Camera Movement

This week I mainly worked on making the player movement more consistent along the track, and making the camera movement more fluid.


Up until this week the camera’s position was locked a specified distance behind the player, giving a very rigid feeling. I tried a handful of techniques to make the movement smoother, and went with the best solution.

The main feature I added to achieve this effect was a clamp on the camera’s movement value based on the player’s speed. The faster the player is going, the higher this value can be. Without taking the player’s speed into account here, the player would either zoom off into the distance and leave the camera behind – or the effect would be cancelled out entirely.

Another thing I added to smooth the camera motion is a slight overshoot when the player goes around a corner. The faster the player is going and the sharper the corner, the bigger the overshoot. This really makes the game feel more flowy and fun.

Finally, I moved a ton of string value calculations from Update() to Start() which improved performance wildly.

-Andrew Weeks