How to use an input to control an AI?

So, I’m trying to make a game where basically I press the Q key and send my pet (a form of AI) to an enemy so it will attack it. So far, I’ve sent a line trace to hit an enemy, which is easy. However, I can’t find out how to make my player character communicate with the AI Behavior Tree… I’ve tried casting (which I don’t think would work anyways), blueprint interface, and event dispatchers, but none seem to work. I keep getting stuck at the beginning, like where I can’t get my character to target my behavior tree. I think I know how to make my pet go to and attack the enemy though. Any ideas? I’m pretty new to this and will be researching this for a few days to come.

for anyone who was wondering, I found this out… Best way to do this is by even dispatchers (idk what is fastest tho). Basically, you place inputs into your character, call an event dispatcher, get your player character in the AI BTS, and then bind the new event with the target as your plyr character.

hi ( don’t know if iyou still need an aswer but here’s mine), I would do it like this: on button press in level bp - fetch the blackboard of your pet and setting some blackboard values in ( like attack-target and state: attack). then inside your pet ai Behaviour tree I would have a node with a decorator that checks for the blackboard value state to be equal to attack. The logic of the attack follows in that node.

Just get player controller>enable input INTO the AI blueprint class. Remember to disable it when you don’t wanna register inputs anymore