O'Reilly logo

UnrealScript Game Programming Cookbook by Dave Voyles

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

Allowing a pawn to randomly patrol a map with NavMeshes

We've been working with bots that operate on maps with PathNodes lately. Sometimes we may find that NavMeshes better suit our needs. In that case, we'll need a bot who can wander around a map while pathfinding. This prevents the bot from running into walls and objects along the way.

If the bot does collide with something along its journey, it will pick a different path.

Getting ready

Open your IDE and prepare to create a new class.

How to do it...

This recipe will be slightly different from our most recent one. Again, we're trying to take advantage of all that UDK offers in terms of pathfinding, so we'll be creating a bot which randomly patrols a map, but uses NavMeshes. NavMeshes are probably ...

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