From the Expected Behavior, we have concluded that we need a Perception System to check whether the agent is able to see the Player.
Once again, we can create our AI Controller both in Blueprint or C++.
From the Expected Behavior, we have concluded that we need a Perception System to check whether the agent is able to see the Player.
Once again, we can create our AI Controller both in Blueprint or C++.
First of all, create a new AI Controller and name it BP_ChasingAIController by selecting the AIController Class:
In the editor, we need to add two variables (so that the Service we build in the next chapter will be able to retrieve the values within them). The first variable is LastKnownPlayerPosition of type Vector, and the second is CanSeePlayer of type boolean, as shown in the following screenshot:
Now, we need to add the perception component. So, from the Components...