# Problem with UI interactions with light.

**URL:** <https://forums.unrealengine.com/t/problem-with-ui-interactions-with-light/1208563>\
**Category:** Architectural and Design Visualization\
**Tags:** unreal-engine, Lighting, Widget, question, Blueprint\
**Created:** [June 23, 2023, 5:56pm UTC](https://forums.unrealengine.com/t/problem-with-ui-interactions-with-light/1208563 "2023-06-23T17:56:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![GuiHey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GuiHey](https://forums.unrealengine.com/u/GuiHey)\
**Post date:** [June 23, 2023, 5:56pm UTC](https://forums.unrealengine.com/t/problem-with-ui-interactions-with-light/1208563/1 "2023-06-23T17:56:47Z")

</div>

Hello guys,

So, I’m trying to make a UI to change light Intensity and Temperature, especific for a group of lights that I want to interact in game.

I was able to make the lights turn on and off setting a collision box and especifing each “group” should be lighten with a Actor tag. And was able to make a widget with the sliders to change the values.

But now, I’m not having sucess on making this modifications.  
I don’t know if I was able to explain.

 ![Doesnt work.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/a/5/9a592b583ef61d61edd62fbf895ece712924fb35.jpeg)  
 ![widget](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/4/f/e4f20e38bff162b20bb2c97248f1871ace74a545.png)  
 ![Lights_BP](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/9/0/b901375418ba7101c688357a0cd0c14d11916a5b.png)

---

<div class="post-metadata">

**Author:** ![GuiHey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GuiHey](https://forums.unrealengine.com/u/GuiHey)\
**Post date:** [June 23, 2023, 6:01pm UTC](https://forums.unrealengine.com/t/problem-with-ui-interactions-with-light/1208563/2 "2023-06-23T18:01:52Z")

</div>

Sorry guys, I think i messed in the lasts lines.  
I’m not being able to input the values of the sliders in the lights that are meant to be modified, and when I do, it just change for a single set of lights. When I try to modify others sets, It doesnt work

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 23, 2023, 6:25pm UTC](https://forums.unrealengine.com/t/problem-with-ui-interactions-with-light/1208563/3 "2023-06-23T18:25:40Z")

</div>

Please move the get all actors of class to either a begin play for actors or on construct in the case of widgets and make the outcome promoted to a variable.

Get all actors of class is a very expensive call to be making per value change. Just loop through the variable array on change.

You are also only changing the first element in the array (the get [0] node). You should be doing a for each loop from the array and setting it per entry.

Same thing with get all actors with tag…cache it to a variable.

---

<div class="post-metadata">

**Author:** ![GuiHey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GuiHey](https://forums.unrealengine.com/u/GuiHey)\
**Post date:** [June 23, 2023, 6:44pm UTC](https://forums.unrealengine.com/t/problem-with-ui-interactions-with-light/1208563/4 "2023-06-23T18:44:48Z")

</div>

Heey, Thanks for replying!

I’m couldn’t fully understand how to do everything you said. If you could be more especific it would be amazing. Sorry for it.

How could I make the element in the array loop with my selection ?

---

<div class="post-metadata">

**Author:** ![GuiHey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GuiHey](https://forums.unrealengine.com/u/GuiHey)\
**Post date:** [June 23, 2023, 6:51pm UTC](https://forums.unrealengine.com/t/problem-with-ui-interactions-with-light/1208563/5 "2023-06-23T18:51:42Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/5/7/457a72ee237f4a3d0a7b1b7c4c5216359568025d.jpeg)  
Hope you meant that, its right ?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 23, 2023, 6:58pm UTC](https://forums.unrealengine.com/t/problem-with-ui-interactions-with-light/1208563/6 "2023-06-23T18:58:36Z")

</div>

The for each loop needs to be called between the on value changes and the set

 ![this](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/7/1e793d4786a7d59ef29a76814b41525caa398021.png)

---

<div class="post-metadata">

**Author:** ![GuiHey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GuiHey](https://forums.unrealengine.com/u/GuiHey)\
**Post date:** [June 23, 2023, 7:08pm UTC](https://forums.unrealengine.com/t/problem-with-ui-interactions-with-light/1208563/7 "2023-06-23T19:08:34Z")

</div>

Niice, already could interact, but it isnt on real time yet, i’ve had to click to interact again to refresh the modification made into the light. And it would make different sets of lights to change as well, there is someway to make the changes just in the lights I’m setting ?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/4/7/f47bf1871c1fd0a70847b898cccb7dc3bd57a3df.jpeg)

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 23, 2023, 10:10pm UTC](https://forums.unrealengine.com/t/problem-with-ui-interactions-with-light/1208563/8 "2023-06-23T22:10:01Z")

</div>

edit: Fixed Light save function on change

[RoomLight.zip](https://forums.unrealengine.com/uploads/short-url/5JKFMbsLahVpnUbqkh3OscaOfHo.zip) (1.6 MB)

Demo

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/e/4/ae46a0bb559d0bd3b0761b4d5bd4888708441ba4.jpeg "Lights") ](https://www.youtube.com/watch?v=tk6lYhhqJx0)

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [July 23, 2023, 10:10pm UTC](https://forums.unrealengine.com/t/problem-with-ui-interactions-with-light/1208563/9 "2023-07-23T22:10:57Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
