copying components?

ok, so I have created a blueprint and added all the components I want in the positions I want manually, not via blueprint but via the components screen, my question is how do I copy those components and use them to create a corridor along a path, I know I need a for loop, I have a programming background that’s not whats bothering me, the question is “how do you copy manually added components in blueprint?” thanks for any help, much appreciated.

If you want to create components procedurally, you want to use an Add Component node in the Construction Script, rather than adding them in the Components mode. Components mode is for components that are always present.

I see, I have a question though, if I add all the components I want as instanced static meshes ( which is what I have done) and then use a blueprint script to AddChildActorComponent for x many loops, that would work for making a corridor right? problem is I have done exactly that and it more or less works but the lighting won’t build, got any ideas?

Did you set the component mobility as Static?

yeah I did, and I also did it the normal way by adding all the components in construction graph, I added a point light component to the modular corridor set to generate a light every two sections, however It seems doing it this way the corridor doesn’t receive any lighting information either, even though all the components have their mobility set to static as do the point lights? any ideas?

Does it work if the point light is not part of the Blueprint (ie just placed in the level)?

Also are you using StaticMeshComponents, or InstancedStaticMeshComponents?

Can you post how you have this light set up in your BluePrint? Does the corridor receive lighting if you generate light constantly or does this only occur with the blinking?

hi sorry for the late reply, I actually get a couple of errors when building the lighting, worldsettings 1 maps need lighting rebuilt, and, Modular_corridor_C_1 has worldtraced blocked. it will be considered world geometry. I disabled the light in the blueprint and added a standard pointlight the only thing I changed was its mobility setting to static and got the exact same results, all the components of the modular corridor are static and I used a scene component as the root( because I read somewhere in the documentation you need to do that if you intend on attaching it to other actors), thanks for the help :slight_smile: the meshes are instanced static meshes added in a for loop determined by an editable integer(corridorLength) I added the instanced static meshes before the for loop then in the for loop I put AddInstance and attached the return value of the original copies into the add instance I used relative transforms to change the position, and that’s pretty much it, everything works except the lighting, when I put in a 4 or 5 into my corridorlength variable the corridor becomes that long, not sure whats going on here. I had an instanced city generated the other day and I didn’t get any problems with the lighting on that from what I can remember. also the modular corridor receives light from stationary and movable light types but it still reports as needing the lighting built that’s all the info I can think of right now actually just checked the procedural city I made and its the exact same thing I must be doing something wrong with the instanced static mesh components at least that’s my guess

I kinda solved this, the instanced static meshes don’t receive any lighting information unless their mobility is set to movable, hope that helps someone if they are having the same problem.