How can I control the distance between AI and player?
I'm very new to all this, but my question is as follows:
I have one AI that I want to follow the main character player throughout a level until they reach the end. There are often hallways and corners in this level and the AI is extremely close to the player to the point where the player often gets stuck and can't turn around.
I need to have the AI maintain a shorter distance between itself and the player but not sure exactly how to do this. I thought Acceptance Radius would do this, but it doesn't seem to do anything when I change the value. Either it simply will not follow at all or it will continue follow just as closely as it was before. There is no middle ground here.
Here is a picture of the blueprint for the Pawn Sensing for this AI character
asked Sep 08 '17 at 10:15 PM in Blueprint Scripting
I've never used that node. You could do better with an actual AI Behavior tree to get more control.
A solution that may not be the best if that radius doesn't work would be to create a custom collision type in preferences. Call it "stop AI follow"or something. Put a collision sphere or box around the player at the distance you'd like the ai to stop at.
Put a sphere around the AI pawn as well make sure they can overlap each other and nothing else.
On component overlap, cast to overlapping pawn and stop its movement until its no longer overlapping.
answered Sep 10 '17 at 02:54 AM
Acceptance radius would work, it's just its measured in cm and 0.5 is incredibly small and may as well just be 0, try maybe 40 or 50.
answered Sep 10 '17 at 08:24 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here