Pawn detection
To give our pawn the most up-to-date information, we need to create an event that will catch and respond to the sensory update events from the AI Perception component. We will establish this by creating a new event that is solely responsible for processing detected pawns. Here are the steps:
Let's right-click anywhere and go under Add Event. From there, we want to add a custom event, and we will name the new event
Detected Enemies
. We have to also create a new actor array parameter namedDetected Actors
to hold the array of Updated Actors.Now, in the next step, we need to recompile a blueprint to call the AIController and the Detected Enemies function from our OnPerceptionUpdated event:
In the next steps, we will handle the transitions between different states. For example, we can be in the default state and find a new enemy. From there, we need to stop the current movement and move toward the detected enemy. If we lose sight of an enemy that we've been chasing for a specific...