Using an Attract Modifier
Last updated
Last updated
The Attract Modifier will attract AI that are within range and invoke the "Attract Reaction". The object the Attract Modifier is attached to will be the source of attraction. This system is intended to extend the functionality of the Sound Detector Component by allowing certain objects, collisions, and custom calls to attract nearby AI.
Find the AttractModifier script by searching for AttractModifier within the Project tab. Drag and drop it on the object you'd like to have attract AI (stone, box, etc.).
After you have added an AttractModifier to your object, you will need to specify your Emerald AI Layer. When the AttractModifier is triggered, it will send information to all detected AI with this layer that are in range, but only to the Emerald AI Layer.
Next, you will need to assign a Reaction Object. For this tutorial, just use the included Move To Attract Source (Attract Modifier) example.
Adjust the Attract Modifier settings as needed. There are options to have the Attract Modifier triggered OnStart, OnTrigger, OnCollision, and with a custom call. Ensure you have a Rigidbody Component on your game object if your Attract Modifier will be using OnTrigger or OnCollision.