Argh

What’s causing this? All of the types are correct, I’ve remade all of the nodes, cleaned and rebuilt the solution, reloaded, it still happens. In fact it’s randomly happened to this very spot of the blueprint since 2017. Cursed ground? Maybe.

I also can’t seem to cast to the C++ type that the class I’m spawning inherits from, if that’s at all related.

Did you try to use “Set members on struct”?

Eventually, yes. What also helped was ditching the ForEach loops and switching to a For loop so I could get the array itself by reference too. No idea at all why that was a dealbreaker, but once I did that the Set Members On Struct started working. So it looked like:

Array -> Foreach -> Array -> Foreach -> Use Index To Get Item By Ref -> Set Struct Members

And it didn’t work until it looked like:

Array -> LastIndex -> For -> Get Item By Ref -> Array -> LastIndex -> For -> Get Item By Ref -> Set Struct Members

In fact, even if just the first loop was a foreach it still broke, which is strange because it should still be a copy of the array that contains a reference to an item that we’re changing. Go figure.

I think ForEach should default to getting the item by reference, it’d be so much more useful (and faster) than copying the array each time an item is accessed, or at least have an option for it on the ForEach loop panel.

Whoa, I had a weird problem with arrays today too. But it’s nice to hear you got it working.