Setting up Cover Nodes
Last updated
Last updated
Note: Emerald AI 2024 version 1.3.0 or higher is required to use this component.
Cover Nodes are position points that the Cover Component can look for. These are searched for based on the user set Cover Node LayerMask within the Cover Component.
To create a Cover Node, you can right click within the Hierarchy go to Emerald AI>Create Cover Node or at the top of Unity go to GameObject>Emerald AI>Create Cover Node. This will create a new Cover Node for you to position in your scene. As many Cover Nodes as needed can be created and used.
You will want to position your Cover Node behind an object with a collider on it. You can do so for both direction if desired. It is recommended that the object have a NavMesh Obstacle or are baked with NavMesh to ensure an AI navigates around the object. The Cover Node should be positioned just above the ground.
Cover Nodes work by giving an AI a position to move to and attack from. This overrides an AI's default behavior where it simply attacks and chases its current target.
The white forward facing arrow on the Cover Node is used to control the intended direction for the cover. This based on the forward direction of the Cover Node.
An AI will pick a Cover Node based on the following conditions:
The Cover Node must be unoccupied
The Cover Node must be within certain forward facing angle limits of all currently detected targets.
The Cover Node must be further than the Min Cover Distance (set through the Cover Component) from all targets.
The Cover Node's forward direction must be within the Nodes Angle Limit to any target.
The distance to a Cover Node does not exceed the Max Travel Distance (set through the Cover Component).
These conditions ensure that AI intelligently and strategically pick Cover Nodes.
Important: If there are not enough Cover Nodes, or an AI cannot find an unoccupied Cover Node, an AI will automatically generate a position within line of sight of its current target.
Important: An AI will automatically generate a position within line of sight of its current target if it does not have an unobstructed view of its current target. This option can be controlled through each Cover Node and is enabled by default.