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 the enemy movement with AIController script

From the last section, we now have our Enemy object, but there is no movement, yet. So, in this section, we will create the core script to control our enemy by using the similar concept used for the CharacterControl script in Project 4, The Hero/Heroine Part II—Animation and Controls, and New3PSController in Project 5, Creating a Rocket Launcher. We will mix both the scripts and create a new script to control the movements of our enemy following the waypoint and detect the player using the Waypoints script.

Engage Thrusters

We will start by creating the AIController script:

  1. Go to Assets | Create | Javascript, name it AIController, and double-click on it to open MonoDevelop. Since we need to attach ...

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