(4-27) Light switch widget

I’m trying to make a simple light switch (button) with existing UI on the scene. I’ve already created the button and I need help with how to connect it to all the lights so I can change their intensity, and keep them on even if directional light is high in the sky.

Reference the light in the Level Blueprint and hook it up to a dispatcher:

Toggle visibility is for objects to be visible or not. Find the right parameter like light intensity. Not sure what exactly it is. Drag it off the light component and it will show in the list.

Still having issues with the lights, again the button is working:


Problem comes in this part, I made selection for all the lights and made a BP, but cant control their brightness:

Help much needed, and appreciated.

The widget is sending a message to an actor:

image

How is this reference Set? Assuming this is it:

Can you describe how you think it works? Maybe I’m missing something. There’s something dodgy here, if you have the correct type, there’s no need to cast (the blue note).

Also, why get Component by Class if you can just wire in a desired component instead?


Any reason why what I posted originally does not work for you?

Primarily the issue is that I am a total noob at this, so starting from -0. I rally have a superficial understanding of everything.
So what I’m trying to do is change light brightness through a on screen widget, but I can’t figure out how to call all the lights I have for that building. I made a Blueprint for them, but when I click on the button nothing changes.

  • is there more than 1 building?
  • how are the lights made to be a part of the building, are they attached somehow, assigned?
  • if there’s more than 1 building, how do we select buildings?

There are 2 buildings, I’m scavenging parts from one to the other.
Lights are just simple point lights and a lot of them(200+).
Sacrificial building will be removed after everything is collected

There are too many unknowns to suggest a good solution, I’d need to understand how your game is supposed to work. For example, from what you said above, I still don’t know if we’re interacting with all lights at once or with one light at a time.


Assuming it’s all lights at once; for something generic / agnostic (and pretty crude), you could try this:

  • search for and select all point lights you want to interact with
  • give them all an actor tag

  • in the widget:

Thanks, a lot, that really was what I needed. Finally working.

1 Like