O'Reilly logo

Unity 3 Game Development HOTSHOT by Jate Wittayabundit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an enemy AI

In the last section, we created the Waypoints script and the Waypoints object , which will be used to limit the enemy movement and direction. In this section, we need to create the enemy game object, which will contain the waypoint and our AI character. We will use a prefab similar to that of the player character but remove some of it that is not necessary for the enemy.

Engage thrusters

We will start by creating the empty game object to contain the AI and the Waypoints object:

  1. Go to GameObject | Create Empty to create the empty game object and name it Enemy. Then, assign its transform by clicking on this game object and go to the Inspector view to reset the transform to default, as follows:
    • Position X: 0 Y: 0 Z: 0
    • Rotation X: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required