Have you set the Static Mesh of the InstancedStaticMeshComponent (ISMC)?
like that:
If you dont set a relative transform in AddInstancedStaticMeshComponent it will be placed at 0,0,0 inside your ActorBP. Which in your case is alright i guess.
The transform of “AddInstance” and “AddInstanceWorldSpace” should be more important because it determines the Position of that instance you add.
The first one places the instance relative to the ISMC, the second in world space.
I have used a struct array for that kind of thing.
like that:
I am using it to save and load my instances. It works good as long as you don’t have too many instances.
(While putting together this sample, a much better method came to my mind. it would only require you to loop through ISMCs till you find the equal one and use the TraceHitItem to get the instance. That would reduce the unneccesairy looping massivly. I’ll post an image later)
edit:
Here is another solution that I havent tested.
Make 2 Structs. In the first struct you add the variables you need for each instance. In the second struct add the first struct as an array and another variable as ISMC type.
(I had some problems with StructArrays inside Structs in the past. I don’t know if “SetArrayElement” works without bypassing the problem inside a function.)


