Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Unity AI Programming Essentials

You're reading from  Unity AI Programming Essentials

Product type Book
Published in Dec 2014
Publisher
ISBN-13 9781783553556
Pages 162 pages
Edition 1st Edition
Languages
Author (1):
Curtis Bennett Curtis Bennett
Profile icon Curtis Bennett

RAIN AI


We have already looked at a basic wander behavior for RAIN in Chapter 2, Patrolling, when creating patrolling AI, but there, we manually created each possible location for the NPC to go to. In this demo, we will pick random points to wander to from anywhere in the navigation mesh. The NPCs won't have any interaction, though such features are not difficult to add. Here is a breakdown of the steps we will do in this section:

  • Set up a world

  • Build the behavior tree

  • Add a script to pick new points

  • Add the NPCs

  • Learn about the RAIN AI world and behavior tree setup

First, we'll create a new world. Start with a large plane called floor, and add some cubes shaped into walls. You will need to add a navigation mesh and bake it into the scene. These are the same steps we have performed for RAIN demos in earlier chapters. The following is an example of how the scene could look:

Next comes the behavior tree. From the RAIN menu, select Behavior Tree Editor. Create a new tree called RandomWalk. The objective...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}