BTTask_LPSP_Chase
Introduction
The Chase Behavior Tree Task (BPTask_LPSP_Chase) is responsible for basically every check that we need the AI to run when trying to chase a given target. It checks if the target is in range, if it is visible, and if it needs to run to it, among other things.
If you seek to access the BPTask_LPSP_Chase, it is conveniently located at the following path: InfimaGames/LowPolyShooterPack/Core/AI/BPTask_LPSP_Chase.
Functions
Is Not In Range Of Chase_Target:
This function tells us whether the agent is not in the correct range from the Chase_Target. This is important so we can reposition it if needed.
Get Distance To Chase_Target:
This function returns the AI’s distance to the Chase_Target.
Should Be Running For Move_Target:
This function tells us if the AI should be running for its Move_Target, as the Chase_Target is already way too far.
Try Stop Running:
This function tries to stop the AI from running.
Get Distance To Move_Target:
This function returns the AI’s distance to the point it is trying to move towards.
Is Chase_Target Visible:
This function returns true when the AI can see the Chase_Target, and is not blocked by any kind of Actor that prevents it from doing so.
Execute AI:
This function is called when this task is executed.
Macros
Is Path Valid:
This macro tells us whether the AI can find a valid path to a given point. This is important because sometimes we may need to recalculate the entire path if it is not valid.
Editable Variables
Query Template:
This variable holds the ECS query that we need to run for the AI to find its spot to move to in relation to the Chase_Target.
Chase_Target:
This variable holds the Blackboard Key for the Chase_Target.
Wants_To_Run:
This variable holds the Blackboard Key that indicates whether the AI wants to run or not.
Chase_Target_In_View:
This variable holds the Blackboard Key that indicates whether the Chase_Target is in the view of the AI or not.
Range Check:
This variable determines the acceptable range of distances for the AI Agent to be from the Chase_Target. Changing it will update how far or close the AI stays from the target.
Minimum Running Distance:
This variable determines the minimum distance from the Chase_Target at which the AI will start running.
Maximum Flank Angle Allowed:
This variable determines the maximum angle that the Chase_Target can flank the AI before it will reposition itself to better aim.
Private Variables
Controlled:
This variable holds a reference to the controlled pawn, which is essentially the AI Pawn.
Owner Controller:
This variable holds a reference to the controller that owns the AI pawn.
Running:
This variable is set to true whenever the AI Pawn is running.
Move_Target:
This variable is set to the location that the AI Pawn will move to.
Last updated
Was this helpful?
