Creating Intelligent Enemies – Navigation
In Chapters 7, Creating Artificial Intelligence and Chapter 8, Continuing with Intelligent Enemies we saw how to create enemy AI, and we'll apply that knowledge again here to create droids using a simple Finite State Machine (FSM). The droid will be constructed as a Prefab. To start, drag and drop a Droid mesh into the scene. See Figure 10.4:
The enemy droid mesh will form part of a more complex object. The mesh itself is a fraction of the whole. To start building the droid enemy, create an empty object, named Enemy, and make the droid mesh a child of it.
Ensure the empty parent has a blue forward axis representing the direction in which the droid is looking. See Figure 10.5:
Let's add collision and physics data to the object. Add both a RigidBody component and a Box Collider, which roughly approximates the mesh. Ensure the Rigidbody is marked as...