© Casey Hardman  2020
C. HardmanGame Programming with Unity and C#https://doi.org/10.1007/978-1-4842-5656-5_14

14. Player Movement

Casey Hardman1 
(1)
West Palm Beach, FL, USA
 

With our new project in place, let’s start coding our player’s movement. We’re going to get a little fancy with it to exercise our programming skills and learn about some new methods.

As we mentioned in the last chapter, we want movement to be fluid – not jerky, but not slippery, either. A little bit of time to build to the maximum speed will make it less of a sudden jerk when the player begins moving. Likewise, we want some time to lose speed after you stop holding down the movement keys. It won’t be much, because a game like this requires tight control of the character, so ...

Get Game Programming with Unity and C#: A Complete Beginner’s Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.