I have two arrays whose elements are based on a custom struct, and I’m trying to copy one array to the other.The string variable in each element is copied over correctly, but the gameobject in each one (a reference to a prefab) ends up null. Searching the forums and other sites indicates that the latter can’t just be assigned the normal way, but I don’t understand why.
Post your code?
I figured it out: I was copying stuff from one array into another in a script which defined specific elements in the same array, which meant that as soon as that script’s Awake was run it ended up overwriting the stuff that had been copied. I keep forgetting that when you define an array that way even outside of any functions, the code is still called anyway.