Issue getting array length and index from a Structure

I’m trying to implement an attack combo system that pulls different attack animations out of an array but having an issue where the function that’s supposed to be referencing the array of attack anim montages doesn’t appear to be fetching the array length or correct indexes.

To try and break it down…

I have a Structure for my different types of attacks and just focusing on Light Attacks for now, which is set as an Anim Montage array

I have a Weapon BP with a variable of type set to the attacks structure. In here, I have 3 anim montages in the Light Attacks array.

In my character BP, I have a function to fetch the correct attack anim montage, depending on the input. Each type of attack feeds into a function that checks an attack counter, used to play different animations as part of an attack combo. Pic below is just the flow into ‘Light Attack’

The function to check the attack counter takes an input, type anim montage array. This is fed from the Weapon BP attacks variable.

The problem is, when I trigger a light attack, I can see in the output log that the ‘Check If Counter Exceeds Attack’ function is returning an array length of 0, not 3 i.e. the number of light attack anims

Any help would be much appreciated!

Weird indeed! A shot in the dark: If you created the child BPs of BP_MasterWeapon before populating the light attacks array in the BP_MasterWeapon, but after creating said array, you might want to recompile & resave the child BPs. And verify that they have the populated version of the array.

I could be wrong, but if you created the light weapons array, left it empty, and instanced child BPs, it could have stayed empty on the children when you populated it in the parent. Maybe? At least that’s how it would work for a C++ class with a BP child.

EDIT: I also notice that the array is “Instance Editable” + “Expose on spawn”, if you left the pin empty on spawn, it could lead to an empty array that overrides the filled default value? Possibly. Either way, if you populate the array from the BP defaults, there is no need to expose it on spawn or even make it instance editable.