control light intensity with slider

Hi all,

I have worked through a series of functions in the level BP in order to control, select and separate different lighting groups in my scenario. (BP shown below)
I was wondering if someone could show me a way to control the light intensity using a slider in a widget BP with my existing functions.

I appreciate the help.
many thanks

Hello,

i assume you know how to create widget and slider.

Inside your slider you got a event to capture value change.

If your code to change the light intensity is in your player character then do something like this:

Create a widget. in construction reference your character.

Then in the onvaluechange inside your slidebar call your function change light intensity by calling this function from your character reference.

Hope that post helpful.

Hi,
I do know how to create a widget and slider. However, I’m still struggling with how to reference/link my level BP functions to the widget BP slider and make it work.
Are you able to show me how to do this, please?

I appreciate, many thanks.

It depends on what the light is connected to. If the light is connected to your character, then you could do this in your widget’s event graph:

Then, your reference will appear and you can pick your variable:

Hi,
still not working :(…
Basically I can control the lighting using the mouse wheel (up & down), I know how to set a widget BP, show mouse on the screen, etc
but I just want to use a slider to control the lighting intensity from 0 to (max specified), I still can’t make it work. this is a bit frustrating hahaha.
Maybe I will need to adjust a bit my lighting functions in the level BP.

sorry and thanks for the help

in which class bp do you store your function changelightintensity cause if it is set in level bp you can not reference it over other BP and you will need to use event dispatchers?

the function changelightintensity is stored in level BP

Yeah so you can t reference your level bp inside an other.

You must use event dispatchers or move your function inside an other class like your character who can be referenced.

Hi, I copy my functions to a BP actor class, may I know how can make it work, please?

yo,
You simply need to reference your actor somewhere maybe i think you should look at event dispatcher

Create a event dispatcher and send a message from your widget.
in you class where you get the function register you at the event dispatcher and that it is.

====> Other way maybe simpliest solution is to use get all actor of class"whereUgotLightFunction_BP" and call that function when the value change on the widget.

Hi, can you please show me how to do that?
thank you