[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.

2017-05-16-10-40.jpg

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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s