Getting an AI Pawn location within Behavior Tree Task

So my problem at the moment is to get the AI Pawn Location within a behavior tree task. The goal is to get a check if a path is possible from an AI Pawn current location to a waypoint. By getting the AI Pawn’s location before moving, I can make a decorator to check if such a path is possible. Can someone help me? I get errors on calls to getOwner. Thanks.

My current behavior tree for reference

You need to get the controlled pawn’s location, not AIController’s location. We’re aware of this common mistake, and trying to figure out a way to address that on the engine level.

Cheers,

–mieszko

How exactly would I do that with the given blueprint above? Because Event Receive Execute I believe returns an AIController. How would I get the controlled pawn of the AIController?

i don’t know exactly, but in the cpp you can GetPawn() from controller. i believe there is also a function that similar to that in the BP. and i believe it’s more handy to change PawnActor blackboard variable not from Vector but from object. because check Path exist also works with object blackboard variable

Just call Get Controlled Pawn on the controller.