Can't access an actor from Behavior Tree Task

My setup is to get an actor from the player mouse click to AI controlled pawn which it uses in it’s behavior tree to move to.
It works fine until the behavior task, the task itself is activated by a decorator that checks if the EnemyActor is set, and it activates but it cannot find the actor.

One thing to note is that the blackboard key is set as object since there is no option to set it as actor, is that the problem? If so, how can I point to an actor in a behavior tree?

Hi, I always use “SetValueAsObject” without problems. In your blackboard, did you set the BaseClass of your key to Actor?

325622-annotation-2020-12-26.jpg

1 Like

Yes, I did.
The AI Move To works if I set it to move to location from the blackboard and set that location from the mouse click, but not move to actor.

Update:
I’ve read that for some people basic Move To task that comes with the editor doesn’t work but custom one does, for me it is the opposite, MoveTo works, but I want to implement different tasks with actors so I need to be able to make blackboard actor references and retrieve them in the tasks.

I could store logic in the actor and call it from the tree tasks via interface, that way the target actor references will never leave the blueprint, but it feels wrong to me.

Thanks. This solved my issue.