AI Enemy not moving

Hi, did you add a navmesh?

And the execution flow of behaviour trees is from left to right, so it will execute the Wait only if the other two branches fail. From the look of your second image the “Enemy Actor” is “None”, meaning the “Move To” in the left branch will fail (not get executed). Further your “Patrol Location” is invalid, meaning “BTT_FindRandomPatrol” did not set the “Patrol Location”. Because the “Patrol Location” is invalid the “Move To” will fail and therefore the “Wait” will not get executed. So the only thing that the behavior tree in your second image will do, is the “Wait” on the right.

I followed the documentation to the word in creating a patrolling enemy. However, the enemy does not move at all. I checked the BT and it seems to skip the “Line Of Sight” and the “Move To” sequences and just goes to “Wait.” I ran the visual logger and this is what I get for the enemy controller.

Here is the BT itself. It flashes through Line of Sight and Patrol and goes straight to wait…

Enemy Controller!

alt text

Hey,
I figured out the issue with this, the documentation seems to be out of date; instead of promoting the blackboard “Key” input, on the Set Blackboard Value as Vector node, to a variable called PatrolLocation, I used a “Make BlackboardKeySelector” node, and that worked a charm.

6 Likes

Many thanks for that! If I had’nt find your response, I think I’m going mad because of that :wink:
Maybe I had tried to use this BlackboardKeySelector by myself, because I saw this class - but I’m not sure. Thanks again for this solution!!!

1 Like

Even if this solve the problem, the method in the tutorial can be used, you just have to make the “PatrolLocation” Blackboard key reference InstanceEditable (in order to make it modifiable from the outside) and then set its value to the actual key in the Behaviour Tree.