I was creating Ranged Enemy Mechanics with blueprints. The mechanics i implemented was if dist. btw player & enemy is under 500m it does a line trace in all 360 direction while storing each elements value as 1 degree. After that I created an array to add if the trace results for all 360 is true or false.
After that i stored data using for each loop to get current empty space and Max Empty Space. After getting max empty space i want to get the last index and first index of it. So that I can use the value to determine the direction where the ai should roll or dash.
For that i need to divide first index and last index /2 and get that index no. and set the direction to dodge and roll using that direction.
So, I need help getting it implemented the code is correct till getting the value of max empty and current empty space. But I need help getting the value of first and last index and getting the direction.
I am a artist by background and don’t know to code. So, even Ithough I know the logic I am getting confused while implementing.