Forbidden boundaries

In this recipe, we will demonstrate how you may be able to prohibit an AI from crossing an invisible boundary by basic movement. Much like a child's play pen or a dog's yard, you will be building a fence in an area for your AI.

Getting ready

  • Before we begin, you must have Sandbox 3 open
  • Then open My_Level.cry
  • Place three AI Grunts roughly five meters apart in any fashion

How to do it...

  1. In the RollupBar, click on the AI button.
  2. From the Object Type, select ForbiddenBoundary.
  3. With the Follow Terrain enabled, click four points roughly in a square around the placed Grunts.
  4. Generate the AI navigation.
    How to do it...

How it works...

The forbidden boundary is much like a fence for the cattle on a farm. The forbidden boundary deters the AI entities from crossing it with their basic movement behaviours, but they may still be able to cross it if they use attacks or other special animations that change their location at the end of the animation (for example, jumping a fence using Smart Objects). Once crossed, they will not attempt to try and return to the other side.

Remember to regenerate the AI after creating or changing a forbidden boundary.

See also

  • The Forbidden areas recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.249.220