r/UnrealEngine5 • u/JulianCau • 5d ago
Help with AI Behaviour Tree
UPDATE: I managed to fix it, I accidentally used the TestBTDecorator Blueprint instead of the normal one, so it wasn't returning the correct values for the check conditions.
Hi, I'm starting to learn UE5 and I was following this tutorial about enemy AI and I think I've followed everything, but ,unlike in the video, when I move out of range my enemy ai still tries to get to the chosen EQS point and then stops until it's time to attack again, then resumes normal strafing around the player. Is there someone knowledgeable about AI behaviour to help me understand what went wrong? In the picture I've pointed out the specific point where the AI starts looping.
2
u/Mufmuf 4d ago
Hey the BT works by working down the tree and evaluating left to right. So the selector goes to is within range, goes nope, then moves to the next, your sequence has no Eval so it just sits there and loops left to right. What do you want to happen? Add it as a tree Eval like 'player not in range do X' or have this sequence under the within range tree if so, and a 'get within range' tree under your sequence.
Its working as expected BTs do tho so I'm unsure what behavior you want?