Skip to content

Learn how to make NavMeshAgents find valid cover spots from another target object.

License

Notifications You must be signed in to change notification settings

llamacademy/ai-series-part-29

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Navmesh AI Tutorial 29 - NavMeshAgents Hiding and Taking Cover

Learn how to make NavMeshAgents find valid cover spots from another target object. In this video we'll specifically use a Player, but this can be applied to hide from any object - a grenade for example. Together we'll create a configurable script that allows us to refine which objects are valid to hide behind, and exclude those that are not.

We'll add the following possible configurations:

  • Layers of objects to consider for cover, and to hide FROM
  • Radius to check for objects to hide behind, and FROM
  • Size of objects to hide behind
  • Distance from object cover must be
  • How good of a hiding spot it must be to take cover
  • How frequently to check for new hiding/cover spots

Youtube Tutorial

Patreon Supporters

Have you been getting value out of these tutorials? Do you believe in LlamAcademy's mission of helping everyone make their game dev dream become a reality? Consider becoming a Patreon supporter and get your name added to this list, as well as other cool perks. Head over to https://patreon.com/llamacademy to show your support.

Gold Tier Supporters

  • YOUR NAME HERE!

Silver Tier Supporters

  • Raphael
  • YOUR NAME HERE!

Bronze Tier Supporters

  • Bastian
  • Jacob Martin
  • Trey Briggs
  • AudemKay
  • YOUR NAME HERE!

Other Projects

Interested in other AI Topics in Unity, or other tutorials on Unity in general?

Requirements

  • Requires Unity 2019.4 LTS or higher.
  • Utilizes the Navmesh Components from Unity's Github.