Making the AI go to a location when the player enters a proximity trigger
In this recipe, we will demonstrate how you may be able to give a basic Go
to
command to an AI (Artificial Intelligence) when the player enters a trigger.
Getting ready
Open Sandbox and then open
My_Level.cr
y
Complete the How to beam the player to a tag point from a trigger recipe to learn how to place the proximity triggers
Then place down a new Grunt
How to do it...
First, place down a proximity trigger and a solid with the same dimensions and properties as the previous recipe.
Then place down an AI tag location within that same trigger area.
Next, create a new Flow Graph from the trigger area called
AI_
Goto
.Within the Flow Graph, create the following logic:
From the perspective viewport of the editor, select the ProximityTrigger and the TagPoint
Add Selected Entities to the Proximity Trigger Flow Graph
Add Node | AI | AIGoto
Select a Grunt from the perspective viewport.
Back in the Flow Graph, right-click AIGoto | Assign...