Behavior tree wont run wait or task

Im following zoombapups tutorial on AI “Unreal Engine AI Tutorial #1 - AI Guard Part Three - YouTube
And im stuck, the tree keeps running in a loop between guard position and running to the position that he heard a noise. Its working like it should at first, except that the bool in the task is suppose to reset itself, it doesnt. It stays true in the blackboard.

So what happens is that the pawn runs to the guard position, I make a noise behind the wall, the pawn runs to me.
Then it pauses a little, runs back to his guard position, then back to me again (without me making a noise), and it just continues like this all the time.

Thanks for any help I can get. :slight_smile:

From what you describe (both here and on the pics) I can tell that the Move To task (task number 10) finishes with a “failed” result, that’s why the tree fails the HearSomething branch and proceeds to GoToGuardPost. Would you mind posting some images of your move task setup and your level’s geometry (preferably with navmesh drawing enabled)?

Cheers,

–mieszko

Thank you for the reply. :slight_smile: I appreciate it.
Here are some more screenshots.

So, I’ve been scratching my brain out yesterday, and pretty much tried a lot of different things.
Firstly I disconnected every other branch of the behavior tree, and just ran the hasheardnoise branch.
i disconnected the “move to” part, and then it works just as it should. The false and true works as expected.
So you were right, MieszKoz, for some reason the “move to” breaks the tree.

I print stringed the vector it gets, and it seems fine, it gets the location, and the pawn moves to the location. It just never moves on from the “move to”.

I also replaced the “move to” from the vector coordinates it receives, to a target point in stead, and then it works just fine, it proceeds the further down the tree.

So my only conclusion is that this has something to do with the vector it receives and it somehow fails to realize that the pawn actually has moved there.

Im out of ideas guys, any help? :slight_smile:

Try increasing task’s AcceptanceRadius or project the goal point to navigation before using it for movement (for example before putting it to blackboard). I think I know what’s wrong, and if I’m write both those things will work (but projecting is the better one).

Im not quite sure what you mean by “project the goal point”? I think I know what you mean, projecting something on the ground that acts as a new vector point? I’m not sure how to do it though.

Increasing the acceptance radius didnt work.

Thanks for all your help. :slight_smile:

ProjectPointToNavigation, a function in BP.

Thank you so much for all your help, it worked to put project point to navigation :slight_smile:

For reference, this has been just fixed on main branch.

Can you tell me how did you use ProjectPointToNavigation to fix your wait task issue?