Companion AI act very similarly to Aggressive AI. They will attack detected targets who they have an Enemy Relation Type with. However, they will not wander according to their Wander Type. They will instead follow the assigned Target to Follow. This can be done through the Behaviors Component or through code.
To set an AI's behavior, go to the AI's Behavior Component and expand the Behavior Settings foldout. Set the Current Behavior Type to Aggressive and assign the desired transform to the Target to Follow. This can be either another AI or a player.
Important: When an Aggressive AI has a Target to Follow, it will make all options within the Behavior Settings unusable.
Once you have set your desired behavior settings, your AI should be able to follow its set Target to Follow and attack any detected target that has a Relation Type of Enemy. If your AI is not detecting targets, ensure that that you have completed all steps within the Getting Started section of the Emerald AI Wiki.
There are two ways to assign a Target to Follow through code, if desired.
The first method is to assign a Target to Follow through the static EmeraldAPI class. The TransformToFollow would be the target you would like the owner of the EmeraldComponent to follow.
The second method is through the AI's own detection component. The TransformToFollow would be the target you would like the owner of the EmeraldComponent to follow.