Get Actor from Blackboard Key (Type: Object, Base Class: Actor) after setting a Actor value?

Hi!
I’m having trouble getting an actor from a AI Blackboard key. Any ideas?

My objective: Able to set an actor in the blackboard and get it for different AI tasks.

  1. The blackboard key is of type is Object and base class Actor (see image1).
  2. I can successfully set the keys value as an Actor (see image2). Unreals already existing task MoveTo moves the AI to the Actor, so the “set” seems to work.
  3. But when I try to get/read the blackboard keys value I can only get the Object and not the Actor (as far as I know). And many functions/nodes needs an Actor for input, not an Object.

Any ideas? Or should I just store the value on the actual AI blueprint and cast to it every time i need it?



Got a solution from the renowned game designer Mr.Goop, thanks!

Create a variable of type Blackboard Key Selector in the Task that you want to access the Actor. From “get Blackboard Key Selector variable” you can pull out the node “get Blackboard Value as Actor”. Make the variable instance editable and populate it with the blackboard key you want to access in the behavior tree when you use it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.