Driving parameters via code

Before going any further, we'll need a few things from the assets we imported earlier in the chapter. For starters, go ahead and open the DemoScene for this chapter. You'll notice the scene is fairly stripped down and only contains an environment prefab and some waypoint transforms. Go ahead and drop the EnemyTankPlaceholder prefab into the scene.

You may notice a few components that you may or may not be familiar with on the EnemyTank. We'll get a chance to thoroughly explore NavMesh and NavMeshAgent in Chapter 4, Finding Your Way, but for now, these are necessary components to make the whole thing work. What you will want to focus on is the Animator component which will house the state machine (animator controller) ...

Get Unity 2017 Game AI Programming - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.