# How to edit elements created in for loop in Construction Script but in Event graph during run-time?

**URL:** <https://forums.unrealengine.com/t/how-to-edit-elements-created-in-for-loop-in-construction-script-but-in-event-graph-during-run-time/414572>\
**Category:** Blueprint\
**Tags:** Lights, event-graph, for-loop, unreal-engine, construction-script, question, Blueprint\
**Created:** [January 14, 2018, 10:27pm UTC](https://forums.unrealengine.com/t/how-to-edit-elements-created-in-for-loop-in-construction-script-but-in-event-graph-during-run-time/414572 "2018-01-14T22:27:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dogrush](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dogrush](https://forums.unrealengine.com/u/dogrush)\
**Post date:** [January 14, 2018, 10:27pm UTC](https://forums.unrealengine.com/t/how-to-edit-elements-created-in-for-loop-in-construction-script-but-in-event-graph-during-run-time/414572/1 "2018-01-14T22:27:18Z")

</div>

Hi there, I’m creating a group of lights through a for loop in Construction Script, and i need to affect the color of the lights in event graph during run time. I have attempted many ways, such as storing the created lights in an public variable Array of lights but I wasn’t successful.(maybe i’m failing to understand the different ways the light arrays could be defined).

I have also tried to create the for loop in event graph but it seems i’m creating a huge amount of lights and the fps drops immediately. If you could point me to some piece of documentation or give me any hint how to solve it i’ll be very thankful.

 ![227034-arraycreation.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/8/9/c89353fd34c9c97b3b824a6c9a28139c5464518c.jpeg)

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [January 14, 2018, 10:45pm UTC](https://forums.unrealengine.com/t/how-to-edit-elements-created-in-for-loop-in-construction-script-but-in-event-graph-during-run-time/414572/2 "2018-01-14T22:45:05Z")

</div>

Hey there, if for some reason storing the components in an array doesn’t work you can call Find Component by Class and that will give you all of the components of a type your actor has.

---

<div class="post-metadata">

**Author:** ![dogrush](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dogrush](https://forums.unrealengine.com/u/dogrush)\
**Post date:** [January 15, 2018, 2:31am UTC](https://forums.unrealengine.com/t/how-to-edit-elements-created-in-for-loop-in-construction-script-but-in-event-graph-during-run-time/414572/3 "2018-01-15T02:31:15Z")

</div>

Hey xlar8or thnx for your answer. Is it possible to identify a single iteration of the light within the component class search? I would like to send a specific color x id of that for loop. I’ll try it out, but you might have knowledge on that. Maybe it has an id or naming related with the for loop creation order?

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [January 15, 2018, 11:17am UTC](https://forums.unrealengine.com/t/how-to-edit-elements-created-in-for-loop-in-construction-script-but-in-event-graph-during-run-time/414572/4 "2018-01-15T11:17:55Z")

</div>

If you want to distinguish between lights while doing the loop you can check the name or you can add tags.

---

<div class="post-metadata">

**Author:** ![dogrush](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dogrush](https://forums.unrealengine.com/u/dogrush)\
**Post date:** [February 23, 2018, 9:24pm UTC](https://forums.unrealengine.com/t/how-to-edit-elements-created-in-for-loop-in-construction-script-but-in-event-graph-during-run-time/414572/5 "2018-02-23T21:24:03Z")

</div>

Thnx very Much xlar8or! sory for my late reply
