Cannot add struct to array without adding element to internat array

I ran into this problem with structs and arrays today while working in my procedural world.

I got an array of stucts. Each struct contain their own array. The problem occurred inside blueprints. Adding a struct to the first array seem to require that each of the variables or arrays inside the struct also get populated. Fine, I can create the array… but the only available node is “Make Array” and it wants to add an element… (Description : Create an array from a series of items). But I don’t want to add any elements yet, or rather, I can’t because they don’t exist yet.

Funny thing is, I accidentally solved this just now… you can right click on the “in pin” item in the “Make Array” node and choose “remove array element pin”. This way, an array can be created without any elements :smiley:
But this wasn’t very intuitive for me as a new blueprint user (and experienced programmer).

A small change suggestion for the Make Array node :

  • Remove the default item that it tries to add to the array.
  • This would leave left side of the node empty like seen on the image, add a “Add pin +” on the left side as well (can be named differently to make its function more obvious).

Yep, thats current behaviour of structs in bp. You can reserve something like -1 for blank spot member and check it before use to separate actually “empty” array from not empty.

Still a thing in 4.23, what you can do is create a function and use empty local array to make your struct

lol, I didn’t know you can remove the pin from make array node :smiley: