This variable is null and doing what you’re doing should throw an error. Creating a variable that can reference a component is not the same as instantiating a component.
Here is the equivalent of what your Struct contains:
It has no value yet . And now it does:
We’ve created an actual object, placed it in the memory and asked the variable to keep track of it. The ref is not the object, it’s the address of the object in memory.
In your very case, I believe you’re after this:
Working with Struct arrays can be tricky. There is also, of course, a question of why we’re doing it this way in the first place (and what we’re even doing!). You may have a great reason and no other choice, or there might be a better, more efficient way. Soft references come to mind…