How to add UInstancedStaticMeshComponent at runtime?
I'd like to add UInstancedStaticMeshComponents at runtime to my actor, but outside of the constructor. The reason for that is, that I have a TArray with static Meshes, that the user can fill with statis meshes. At runtime, for each of those added static meshes, a Instanced Static Mesh component should be added for each mesh, which then gets instances added to it as needed. I have a blueprintcallable method in my actor, that needs to add those components.
I tried storing components in an own TArray, where wheach component is created with the NewObject function. I also attach the component to the RootComponent and add instances. But nothing is rendered in the scene.
Can somebody tell me, what I am doing wrong here?
asked Jan 09 '15 at 07:36 AM in C++ Programming
I forgot to call the RegisterComponent method on the new components. Now it is working as intended.
answered Jan 09 '15 at 08:26 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here