In this chapter, we will cover the following:
Many games involve moving computer-controlled objects and characters. For some games, animation components can be sufficient for all such movements. However, other games use directional logic—simple or sophisticated artificial intelligence involving the computer program that makes objects orient and move towards or away from the player or other game objects and characters. This chapter presents a range of such directional recipes, from which many games can benefit in terms of a richer and more exciting user experience.
Unity provides sophisticated classes and components, including the Vector3
class, and rigid body physics for modeling realistic movements, forces, and collisions in games. We make use of these game engine features to implement some sophisticated non-player character (NPC) object movements in the recipes of this chapter.
18.222.32.67