AI logic

Good day everyone,

I am trying to create a behavior tree for an AI

I have done simple ai commands and I was wondering how I could program a function which will command the AI to create some sort of wall to protect a tower. Keep in mind that I am doing this with C++ and a small portion of blueprints. I just need a little help getting this started and I am pretty sure I will be on my way.
I know that I need a vector for the distance where if the player enters this distance the AI will create a wall and attack the player but how can I do this ?

I had in my something like if(ProjectCharacter.location <= DefenceDistance)
{ AiController->MoveToLocation()}

Something along these lines however I am not entirely sure if this could work

Thanks in Advance !

You need a service or task to handle the logic. You will need something like an array to reference the other people in the wall. You then pick a location in your task logic and update all the blackboards with the required positions.
You then would flag that the process is completed by a state change or whatever and everyone would stop looking.
You’ll need some logic like that to determine when to look for a new wall position for everyone.

I’d probably do something like that.

Would you have an example to show me ? it doesn’t have to be complete ! I just need some visual help and then I will be on my way ! :stuck_out_tongue_winking_eye: