Get AI Character's Location in Behaviour Tree

I am making an AI behaviour tree for my Enemy Character for the first time. For some reason I can’t seem to find a way to get the enemy character’s location inside My services.

I am not using a Pawn, I’m using a Character blueprint. I’m not sure if that will create issues or not.

What method would I use to do this?

This is very simple to do, and there is a few ways to do it. Because you mentioned a service we will do it that way.

Inside your service you can override the Receive Tick AI event, this will give you access to the controlled pawn. Simply drag off the controlled pawn pin and type “Get Actor Location”. You can then save that to the blackboard if you need to by dragging off the output vector and typing “Set Blackboard Value as Vector” and providing it with an exposed Blackboard key (Which you would connect to a blackboard variable to use throughout your behaviour tree).

Ahh. I see now. It looks like I may have been using the wrong. Event Receive Tick node. (Of which there are two) can’t imagine why there need to be two, but I will try it and get back to you.

Great, It works well. Thanks for that.

No problem. They are actually the same event, but the AI events are just for convenience, they do some class retrieving behind the scenes to provide you with the controlled pawn pin, this way you do not have to and keeps your graphs a bit cleaner. There really is almost never a case to use the non AI events. At least I have never found a use for them.

Thanks for that bit of advice. This is the first time I have made AI with the Behaviour Tree rather than pure Blueprints. Every bit of Info is hugely appreciated.