Task 'Move to' from Behavior Tree flashes but does not work

I have a BTTask that, based on the location of the NPC, searches for a specific blueprint actor using ‘Get All Actors of class with tag’, as I know I only have one the result I get as ‘GET COPY’ index ‘0’ from that I get the ‘Actor Location’ and the location vector I keep in a Blackboard key passed as a BTTask parameter.
When this location is obtained then the BT through the Decorator calls a ‘WAIT’ of 0.5 and then a ‘MOVE TO’ using the location stored in the BB key.

I checked and the location is being obtained correctly. The behavior tree executes a wait of 0.5 and arrives at move to, the yellow line indicating the execution of BT passes at move to and returns to wait and is “blinking” going to wait and returning to move to and the NPC does not walk.

If I, with my game character, the player, stand still waiting, at some point the NPC starts walking and goes, Move to then locks the yellow until the NPC arrives at the location. Or, if I, as a player, walk to the destination and when I get close to the location, the BT locks to yellow and the npc starts walking to the location.

I use Invoker and NavMeshBounds… it’s fine. When I see the navigation green with the ‘P’ the path is clear to the location, because it’s close and my invoker has 2,000 tile generation radius.

I do not know what else to do.

[EDIT]

BBTask: BBTask_FindCrossLocation posted by anonymous | blueprintUE | PasteBin For Unreal Engine

BT:

Hey @GersonNovais!

Do you think you could get some images to help explain what it is you mean? Starting with maybe some pictures of the BT at work, and you explain what is happening in-game with that image? Please include the BT and the BB variables window! :slight_smile:

1 Like

Thanks for commenting. I even thought about it, but as it was very detailed I ended up leaving aside the prints. But I followed your advice and put the BBTask that finds the location and sets the variable and the BT print.

Thanks.

I think you need to put in a variable on your “Get” on the array. It shouldn’t have a default value, you should plug in a variable, even if it’s 0.

1 Like

I don’t know what you’re talking about, what variable? what Array? I am storing the location vector in a BB key which is a variable of type Vector

image

The nine squares is an array, in this case an array of objects. When you use the “Get” Node you are grabbing an object at a certain index, which is the green node there, which is empty.

So the picture isn’t helping, because there’s no context for the picture. When you say “locks the yellow” What does that mean exactly?

Because what I’m hearing is “The NPC walks to the old painting location, then stands there.” Do you have any other locations for it to move to?

Or is it seeming to get stuck sometimes, and other times it is working as intended?

Hello,
So when we Zoom into the Blueprint somehow it “hides” the value, but the GET always defaults to ZERO, first index and that’s what I get, because I only have one Actor with the specified TAG. As I commented, the LOCATION of this actor is being set, if you follow the BT you will see that the value is set in the right corner of the BT in execution.

This seems to me to be a problem where NAVMESH does not identify this location as being “reachable” by the AI controller and it seems to keep trying, so MOVE TO keeps blinking until a time when it understands that it can get there and starts walking.

Look, my suspicion is in Navigation Invoker. It’s taking too long to “start” it starts picking up a small part and after some time it covers the entire established Tile generation