Behavior Tree Move To Going Crazy

My very simple AI Behavior Tree was working fine, then I open the project today and the behavior tree is going crazy, nothing changed between then and now. I am using UE 5.0.3

Behavior tree gone wild

The location target it is getting in the get btt task is not the same the pawn is currently at, so the pawn should move to that new location. Rather, it is just rapidly cycling back and forth between getting the current location it needs to go to and “moving” but not moving anywhere.

Any help appreciated! Let me know what extra information I can provide to solve this bizarre issue.

Thank you!

Hey @ShadowStrider2!

Hmm. When I run into issues like this (especially with behavior trees), the first thing I do is go to content> rightclick> fix up redirectors. Then I save all, close, restart my pc and try it again. USUALLY that works. Especially with the “Everything was fine before” context.

Give that a try and if that doesn’t work, let’s get some close-up screenshots of the code :slight_smile: that video isn’t high enough rez to see the words on the screen.

Hi @Mind-Brain! Thank you very much for the suggestion and help. I did try what you suggested doing, but it didn’t help any, the issue is still there :frowning:

I think I will just stick to making the AI logic in blueprints and just skip the behavior tree for now. It just seems too buggy for me, maybe it gets some love later idk.

I will deffy try it out later in next project but for this project, I don’t really need the behavior tree as the AI isn’t all that involved and their logic is pretty linear, I just wanted to try it out :sweat_smile:

Thank you again for the quick response and help!

1 Like

Behavior trees are used in many games, and are not particularly buggy.

It’s very likely there is some data that goes into the behavior tree that causes this behavior as programmed, and the solution is either to send in other data, or to program the tree differently.

It is very possible that I did something wrong or changed something unintentional and now it is freaking out, no doubt about that.

I’ll play around with it more, or completely trash it and rebuild to just see. Thanks for the help.

@ShadowStrider2 I highly recommend doing some tutorials on using the BB/BT. It’s very dense, and easy to mess up. VERY testable to find your errors, though!

I suggest this video to start out!

1 Like

I figured out the issue. The issue isn’t with the behavior tree, it was the navigation mesh tile size was set too large for what needed to be done, so it couldn’t find a path to the target and was cycling back and forth. I reduced the navigation tile size and works again.

1 Like

I’m going through the same problem. in my BT I call a TASK that looks for an asset (BP) in the vicinity NPC and sets its location in a BB Key then I use the “move to” of the BT to move the NPC to this location. The behavior in BT is exactly that of your image, but it stops going crazy, if the player (character) goes close to the target asset (BP), then the NPC normally moves there. The BB Key with the location is being set perfectly, that is, it is finding the asset, I already tried to put the “fixed” location vector for testing and the result is the same. I don’t know what else it could be. The scenario is as follows:
I have a small house with 2 floors and in the backyard of this house, almost against the wall of the house, is the Asset of destination and the NPC is on the second floor of the house, both are close. I just want the NPC to leave the house and go to the backyard. It works perfectly, but only if the player goes to the location first.