Chasing the player
The second behavior I worked on was a task for chasing the player during combat. When The player is detected using sphere trace in the AI service called "Detection", the state is switched over to Combat so that a different branch of the behavior tree can be selected.
For now, the Detection blueprint uses a sphere trace which has a start point ahead of the AI character to avoid it being triggered when the player is behind the character. The hit result is broken and the hit actor variable is used to cast to the player character as a simple check. If the cast fail's, the hit actor is not the player and the the AI will continue its patrol.
When the state is changed to Combat, 2 tasks are called simultaneously using a simple parallel. "Track player" uses a line trace for objects from the AI to the player location, which will continue to update a Vector with the player's location until the line of sight is is broken. "Chase player" sends the AI to the players location to within a certain distance so that I can add an attack function later.
Progress video
Next I hope to add some attack and search functions to my AI so that I can start really testing the stealth mechanics, and making all round improvements to my project. I have around 77 days until the deadline and want to reserve as much time as possible towards QA and polish.