Movement, Camera Controls, and Collisions
One of the first things a player does when starting a new game is to try out character movement (if, of course, the game has a moveable character) and camera controls. Not only is this exciting, but it lets your player know what kind of gameplay they can expect. The character in Hero Born will be a capsule object that can be moved and rotated using the W, A, S, D, and arrow keys, respectively.
We’ll start by learning how to manipulate the player object’s Transform
component and then replicate the same player control scheme using applied force. This produces a more realistic movement effect. When we move the player, the camera will follow along from a position that is slightly behind and above the player, making aiming easier when we implement the shooting mechanic. Finally, we’ll explore how collisions and physical interactions are handled by Unity’s physics system by working with our item pickup Prefab.