How to set up a custom BP to put an Array into Blackboard Key?

In this post:

Mieszko mentions that arrays aren’t supported as a blackboard key and recommends making a custom blueprint to store the information and then use Blackboard to store that.

I have just in the past few days learned about Arrays and Blackboard/Behavior Trees - I’m kind of lost as to where to begin with making this custom blueprint. I’m trying to store a list of enemies a character will sense with AIPerception so the character and their teammates can switch targets based on that list after killing their current targets.

Any pointers to get me started will be appreciated, thank you!

It would surprise me if this is still an issue. I do think that arrays work as blackboard keys (as long as they are one of the types, actor, string, float, etc.).

If not you can just create a Blueprint class, which contains the actor array you want. Then place it in the world. Then, in the controller where you apply the behavior tree + blackboard, save the actor value into the Blackboard. Subsequently when you write your AI task or service you can obtain a reference to this actor, cast to the class and save it. Now if you use the reference you have access to the array!

I’ll try that out and let you know how it goes!

I did it! I was able to use this set of blueprint suggestions here: