O'Reilly logo

Unity 4.x Game AI Programming by Thet Naing Swe, Aung Sithu Kyaw, Clifford Peters

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

Chapter 5. Flocking

Flocking is the idea of many objects moving together as a group. We could sit down and tell every object how it should move, but that would take a lot of work. Instead, we want to be able to create a flock leader to do that for us. After that, all we need is a few rules and the boids will be flocking all on their own. In this chapter, we'll learn how to do that and implement flocking behavior in Unity3D.

We'll implement two variations of flocking in this chapter. The first one will be based on a sample flocking behavior found in a demo project called Tropical Paradise Island. This demo came with Unity in Version 2.0, but has been removed since Unity 3.0. The second variation will be based on Craig Reynold's flocking algorithm. ...

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