AI Patrol move backward
This is for 2d Paper, maybe it's for 3d Sidescroller too.
I used a simple AI Patrol with Behaviour Tree, but the problem is that the moment the AI spot the Player through the Sensor Sight (In AI Controller) and when the AI doesn't detect my Player, it goes to the backward path point (Target Point Location) instead of going to the forward path point.
I mean, my game has 2 path point, one from the left and one from the right.
1.-If the AI sees me when i'm in the left side and when i leave its sensor sight (If i left from the left side), the AI will go to the right side (Backward) instead of going to the left side (Forward).
2.-And vice versa, if the AI sees me from the right side and when i leave its sensor sight from the right side, the AI will go to the left side instead of the right side.
3.-If the AI sees me from any side, lets say from the left side and when i leave its sensor sight from the right side (Since the AI has 90' angle and of course, the AI will turn its body towards me), then the AI will go to the left side, where it spotted me.
My BT is too simple (From the UE4 Basic AI Tutorial, since i still doesn't a lot how to do with the Key things).
The problem is, what should i do to make the AI go forward instead of backward? Because the AI will go to the opposite side from where i leave its sensor sight and i don't know what is the problem.
I want to make it go from path 1 to path 2, even if i interrupted it with the sensor sight, i want the AI still going in an order of path 1 to path 2 then to path 1 and path 2, instead of going to the opposite side...
The AI sensor sight task (FindEnemy) doesn't has nothing, it's empty, i left it so it can stop moving when it sees me.
Thanks for the answer, i appreciate it since i don't even know what is the problem behind it, so i think, it will take me a lot of day to resolve it alone (Maybe forever... since i want to use BT instead of BP that i find it quite easy than BT).
PD: the AI patrol does work fine when the AI doesn't spot me, it goes path 1 to path 2 and vice versa.
Follow this question
Once you sign in you will be able to subscribe for any updates here