Implementing movement
Almost every object in the game moves one way or another, the Player character with the keyboard, the Enemies through AI, the bullets simply move forward, and so on. There are several ways of moving objects in Unity, so we will start with the simplest one, that is, through the Transform
component.
In this section, we will examine the following movement concepts:
- Moving objects through Transform
- Using Input
- Understanding Delta Time
First, we will explore how to access the Transform component in our script to drive the Player movement, to later apply movement based on the Player's keyboard Input. Finally, we are going to explore the concept of Delta Time to make sure the movement speeds are consistent in every computer. We are going to start learning about the Transform API to master simple movement.
Moving objects through Transform
Transform
is the component that holds the Translation, Rotation, and Scale of an object, so every...