Setting up the Cover Component
Last updated
Last updated
Note: Emerald AI 2024 version 1.3.0 or higher is required to use this component.
The Cover Component gives AI the ability to search for Cover Nodes and use their positions for cover and attacking. Upon detecting a Cover Node, an AI will travel to it and rotate towards their current target. Depending on the setting for the Cover Node, the AI will either stand, crouch then attack for the set Peak Seconds, or crouch and repeatedly peak based on its Peak Times. This can help AI feel more intelligent and challenging for players and other AI to fight. There are various settings to control how your AI react when they are active on a Cover Node.
The first thing you will need to do is assign a LayerMask for your Cover Nodes. This allows the Cover Component to efficiently search for objects only using the specified layers. These layers should be exclusively used for your Cover Nodes. It it recommended to only use 1 to keep the setup and management as easy as possible. For this tutorial, the Cover layer is being used.
The rest of the settings can be customized as needed. Each setting has a description of its functionality. It's worth noting that only one AI can use a Cover Node at a time. Emerald AI and its Cover Component manages this automatically.