Get an array from all instanced mesh instances?

Hey!

I have created a blueprint, that spawns loads of instances of various instance-meshes to generate a maze. The problem is, i want to make changes to these instances. Is there a way to build an array of all those instances? The “Add InstanceMesh”-node doesn’t have any output parameters, but only creates a mesh without any handle. Is there any functionality provided to manage that into an orderly fashion?

15356-screenshot+2014-09-14+14.57.15.png

Hello clawjelly,

You should have a function called Add InstancedStaticMeshComponent which has a return value as shown below :

15362-add_instancedstaticmeshcomponent.jpg

Hope that helps

Alright, as far as i understand this, this function takes an existing actor and replicates an instanced mesh from the actor’s mesh (whereas my present way is just instancing an instance-mesh-component)…? As such i’d have to create an actor from a class first in the game, as i don’t have those meshes in the game at that moment. This also means i have to change the way the object templates are stored. Thanks, I will test that tomorrow!

I exchanged the function now, but something is not working. The function gets fed the same values (just actors instead of inst-meshes), but i don’t see any geometry. My one and only character just falls into emptyness. Yet the return value seems to actually deliver a properly instanced object, because i can log the correct name and the position to the screen. Almost as if the object was invisible, but yea, i checked that, setting it visible isn’t changing anything.

Is there anything i have to do elementary different with that function that i might overlook here?

I ran into this problem at one point but I didn’t have time to work it out so I just stayed with Add Instance. But now I need to alter the transforms of my instances… Anyone know what the deal with this is?

I don’t think that’s what the OP is looking for, Caracole. He’s specifically avoiding StaticMesh Components in favor of StaticMeshInstances to get the benefit of batched drawcalls… I too seem to be running into this problem, which is incredibly frustrating when combined with this issue: https://answers.unrealengine.com/questions/158576/update-instance-transform-sets-rotation-to-000.html …(especially within BP: as it seems there’s no way to manually fix and set the rotation of instances in that array)

Hi! I think that you have a partial solution here: https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/FindingActors/Blueprints/

Work from this. :slight_smile: