Hi everyone, I’m trying to do a small project to better learn the mechanics of Unreal Engine. I am in version 5.3.
I have created a structure with several variables inside including a variable of type Instanced Static Mesh. I have made this structure an array and am trying to change the Instanced Static mesh using a for loop. I scroll through the array and for each element in the array I set the instanced static mesh using the set static mesh construct. I don’t understand if it is me misunderstanding how to use the construct or there is more to it. Every time I try to assign a mesh it gives me an error “Access None trying to read property”. If I understand this error correctly, it indicates that I don’t have a value in the variable, but I don’t quite understand what I should do. I attach screenshot of how I made the blueprint.
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.
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.
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…