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

**URL:** <https://forums.unrealengine.com/t/how-to-set-up-a-custom-bp-to-put-an-array-into-blackboard-key/434437>\
**Category:** Editor Scripting\
**Tags:** arrays, blackboard, unreal-engine, Array, question\
**Created:** [September 25, 2018, 3:30am UTC](https://forums.unrealengine.com/t/how-to-set-up-a-custom-bp-to-put-an-array-into-blackboard-key/434437 "2018-09-25T03:30:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kami822](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kami822](https://forums.unrealengine.com/u/Kami822)\
**Post date:** [September 25, 2018, 3:30am UTC](https://forums.unrealengine.com/t/how-to-set-up-a-custom-bp-to-put-an-array-into-blackboard-key/434437/1 "2018-09-25T03:30:28Z")

</div>

In this post:

> **[Can you store a struct in a blackboard? And what about arrays in blackboard?...](https://forums.unrealengine.com/questions/172449/can-you-store-a-struct-in-a-blackboard-and-what-ab.html)**
>
> Hi, I want to store an array of structs in my AI Blackboard but I cant seem to do this. There is however a class option - is the way to do it to store all my information in a new class? Or is it possible to get support for structs and arrays in the...

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!

---

<div class="post-metadata">

**Author:** ![BreakMaker](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/breakmaker/32/971651_2.png) [@BreakMaker](https://forums.unrealengine.com/u/BreakMaker)\
**Post date:** [September 25, 2018, 1:42pm UTC](https://forums.unrealengine.com/t/how-to-set-up-a-custom-bp-to-put-an-array-into-blackboard-key/434437/2 "2018-09-25T13:42:55Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Kami822](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kami822](https://forums.unrealengine.com/u/Kami822)\
**Post date:** [September 26, 2018, 12:18am UTC](https://forums.unrealengine.com/t/how-to-set-up-a-custom-bp-to-put-an-array-into-blackboard-key/434437/3 "2018-09-26T00:18:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kami822](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kami822](https://forums.unrealengine.com/u/Kami822)\
**Post date:** [October 23, 2018, 4:11pm UTC](https://forums.unrealengine.com/t/how-to-set-up-a-custom-bp-to-put-an-array-into-blackboard-key/434437/4 "2018-10-23T16:11:57Z")

</div>

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

> **[Getting an AI to clear their Target after killing them (simulating physics to...](https://forums.unrealengine.com/questions/831485/view.html)**
>
> I just recently started learning AIPerception and using it with Blackboard to make an AI capable of team vs team fighting - I'm using On AI Perception Updated and Sight as the primary sense within the AI Controller. Upon an actor successfully...
