Blueprint nested array

Good people,

I want to create an actor (a ball) in UE5 (blueprints) with an array that contains multiple values and arrays. For example:

array [ material: material, name: “name”, weight: 120, possibilities: array[0 => array[etc…], 1 => “yes”, 2 => “maybe”, 3 => “all”] ]

What is the best way to approach this? Do I need to create an actor with an array, then create a child of that actor and create an array of the previous and then create another child actor of the child actor to bind everything together or?..

Simply put, what is the best approach for nested arrays in UE5?
Also, if C++ is THE way to go for nested arrays, I’m open for it, but I have 0 knowledge of C++.

It looks like you need a struct, not an array. Arrays cannot contain items of different types, but structs can. In your ContentDrawer, click Add → Blueprints → Structure, and you can add there anything you want, including arrays. Then this struct will be available as variable type is all your blueprints.

2 Likes

As @Tuerer mentioned, first create a struct that holds the nested array. Then create an array of that struct.

1 Like

@Tuerer and @PEYMAAN thank you, got it!