Book Image

Unity AI Programming Essentials

By : Curtis Bennett
Book Image

Unity AI Programming Essentials

By: Curtis Bennett

Overview of this book

Table of Contents (19 chapters)

The attack demo


Like our previous demos, we will start with a basic scene with a ground and walls. The demos here will involve an enemy ship attacking a player, so add a ship to the scene, name it player, and add simple controls to move the ship around. Also, tint the color of the material to make the player ship stand out from the enemy ship that we'll add in a moment. Of course, the player ship isn't an AI, so it doesn't need a RAIN AIRig, but it does need to have a RAIN Entity component. With the player selected, go to RAIN | Create Entity. Next, it needs a visual aspect for the AI enemies to see it; from the Add Aspect dropdown, select Visual Aspect and rename the aspect to player. This provides a base for our attack demo. This is how the RAIN attack demos will look with a player ship:

Next, we need an enemy for the attack. The enemies will also be ship models, and as we are focusing on just the AI, we won't worry about the actual game mechanics of attacking, such as having the ship fire...