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
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.
- YOUR NAME HERE!
- Raphael
- YOUR NAME HERE!
- Bastian
- Jacob Martin
- Trey Briggs
- AudemKay
- YOUR NAME HERE!
Interested in other AI Topics in Unity, or other tutorials on Unity in general?
- Requires Unity 2019.4 LTS or higher.
- Utilizes the Navmesh Components from Unity's Github.