Enemies stop when player character overlaps with their "line of sight"

Hello all,

  My problem at the moment is that when my player character overlaps with what is supposed to be my npc line of sight; instead of chasing the player which I have them rigged to do they stay in the idle position. I believe part of my problem stems from characters all using one AI controller (The enemies are in different locations around the map, each with a different type of terrain) but when I tried to use multiple AI controllers for them they only the AI tree that I am using would work for that particular AI. So after I had them share the AI tree they seem to work but now when I want them to chase the player on one specific AI works as it should again. Can someone  please help? I can't seem to figure this one out.

Can someone help me with this one?

What do you mean by “all using one AI controller”? How do you set that? And would you mind showing your BT and tasks implementations?

Cheers,

–mieszko

Here is a pic of the AI controller for the enemy “Da”

all enemies share this controller

next is a picture of the behavior tree

The enemies all share this as well;

next is the a picture of the enemy AI “Fitz” who represents how other enemies use “Da’s” AI controller

Notice in the right column he uses the Da controller for his AI controller class

Next is Da’s wander BP which works fine with all the enemies in the game

Finally chase; which worked initially but after closing and reopening the editor somehow does not work anymore…instead of pursuing the player they all just stare at the player in the idle position :frowning:

To note I made a "chase for all the characters which as I stated caused it to work until I reset my editor; if you can help I would greatly appreciate it…

Are these pics enough?

You have a bug in the “chase” BT task. You call FinishExecute just after requesting the move. Note that calling Simple Move To Actor won’t wait to execute node’s output until the move finishes. It will request the move and finish instantly. The move is supposed to be handled “in the background”, transparently to the behavior tree.

BTW, I assume that the fact that your chase task has a ReceiveExecute_Copy event instead of just ReceiveExecute is just a screenshot mock-up issue.

I removed the FinishExecute from the BP but still they just stare maybe I misread you answer is there something else I should do.

So I got rid of the Execute_Copy- which was from when I duplicated the blueprint for multiple meshes to follow these instructions. It worked at first but later didn’t. Now the question is where would I finish the execution or better yet what should I use to separate the finishexecute from the requested action node.

Yea I’m very “green” when it comes to Unreal most of what I have implemented has been either derived from or taken from (like my wander task) tutorials.

So the actual issue might be cause by that mis-named event. Your “chase” BT task blueprint contains "ReceiveExecute_Copyevent. That's wrong. Delete it (the even node alone!) and add it anew. Your can useReceiveExecuteAI` as well, and it should even simplify your BP.

BTW, you still need the FinishExecute call, just make sure to call it when AI finishes the move, not when you request the move.

Well, you decided to implement a movement task yourself then it’s up to you. You could theoretically use AI Move To node instead of SimpleMoveTo, bu that’s a bit of an overkill.

Best solution would be to have a BT service or a task in fact, that would put player pawn into AI’s blackboard as, say, Enemy key, and then use regular BT movement task, like Move To task, to move to Enemy.