Hi MeMe,
I came up with something, but first my code:
(You can right click on that image and open it in a new tab, so you can see it’s contents easier.)
Important things to note:
- The type ‘Type’ is just an enum, containing the fields ‘Type A’, ‘Type B’ and ‘Type C’.
- The struct ‘Data’ is an struct with a field of type ‘Type’ and of type ‘Transform’ (you can change that into just a vector, it just adds more controllability).
- The Map ‘InstancedMeshes’ is of type ‘Type’ to ‘Instance Mesh Component’ (reference)
- The variable ‘LocationAndMeshData’ is an array of type the struct ‘Data’
The construction script gets called every time we either change a variable, it’s transform (location, rotation & scale), and with the actor’s ‘Begin Play’ event. Just to make sure the map is correctly populated, we clear and then populate it with the references via their key (type). After that we clear any instance the Instanced mesh components already have, after that we populate the level with the instances at the given transforms.
This is quite possibly not the best solution, but it should work, and it should be rather easy to expand on it. (It’s quite possibly also quite overdone).
Let me know if you need any further help.