The Variables are OK and filled on the left side of the Loop, but they are all “out of bound” on the right side.
So the Loop practically destroys the content in the variables.
I can grab it directly from the array, and everything is fine.
I cant grab it with the Loop, because “Out of bounds” [0/0] - but it is NOT out of bounds.
So… waht do i do now, i cant do anything without that Loop.
I have no idea either with this picture or description:) I would print a string right before you run the loop and get the length of the array to make sure data is in it. If there is, then I would break the LayerStruct on the other side and for each item in the array, I would print a string with its values to make sure they are set. If all that is working you should be good. I do have one question, what is [0/0] In blueprints, you cannot get data from an array element using that. So if you put that in a get node it will never work…as far as I know…I have been wrong before.
keep in mind that for removing or destroying things out of an array you should make it an invert “for each loop”. because when you remove index 10 all other elements drop one down so you will eventually skip elements. after index 10 is away, index 11 goes to index 10. the loop will skip it then. but that’s probably not your problem, just keep it in mind.
This is what i did.
If i do that BEFORE the Loop, everything is ok. [I checked multiple times, EVERYTHING is correct and filled with Data]
If i do that AFTER the Loop, all Arrays inside the Struct are “Out of Bounds [0/0]”.
If i do it manually, lets say “Index 0” (since this is the first one that the Loop will try to get) this is what happens:
That clearly shows that the Arrays within that Struct are NOT [0/0], There are 512 Arrays, filled with 4 Arrays, and they are filled with 100 Values - everything is there, and ok.
Until i try to grab them automatically.
Something Engine-Related is “broken” (very much broken).
EDIT: It is reproducable, its an Engine Bug.
Does not work with the same layout in the Backup.
I am done with this ****.
My tip for you is to use C++ instead if using complicated operations on array struct. You can use Function Library that’s taking that array struct and make changes on it. It’s not that hard, really. For such things C++ is more like scripting language thanks to UE4 API.
I’m using C++ to store my variables and make more complicated operations. (it’s easier to read, faster to build and iterate) Blueprints is used only for flow, small and visual things.