Implementing movement
Almost every object in a game moves in one way or the other: 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. Then, 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 by learning about the Transform API to simplify movement.
Moving objects through Transform
Transform is the component that holds the Translation, Rotation, and Scale of the object, so every...