Slider updating on real time -> light intensity and light temperature

Hello world !
I got a question:
I’m developing a widget that sets my light temperature and intensity, its working, but i would have to turn on and off my light so it will update. And would be better if it react in real time.

I’m triggering it by line trace by channel. So on first click it would open de sliders and turn the lights on, the second click it will just close the widget, and the for the last it would turn the light off.





I understand that I would’ve to manage to update light not only when i cast the line trace (what its happening right now), but on “tick rate” or on “mouse capture end” ( … maybe), but I’m failing on manage that.

Any ideia on how to do that ?

This is to call an event every (number of seconds) when you hold down the mouse, and stop calling when you release.

Remember to set your light to dynamic.

Hi, thanks for anwsering.
But i think that your tip didn’t work , guess i must did something wrong. Where would I fit that timer ?

And where do i set my light to dynamic? Is it in details ?

1- Light can be set to Movable in the details panel under transformation, this makes it Dynamic.

image

2- Set the timer when you want to begin the interaction, so if you’re using a slider with the left mouse button, use it on button is first clicked, but remember to only trigger it once, not while the button is held.
Then clear and invalidate when button is released.

And the event that is plugged into the timer is this

Make it a separate event.

Sorry, I’m realy new to unreal blueprints.

For sure i did wrong, but I didn’t understand how to set to on button first clicked, as It’s trigger by this interaction, and its a line trace.


@GuiHey Could you print the length of this array?

image

What do you get?

image

This creates a timer then immediately kills it.

1 Like

17

1 Like

I think the getter works fine since the lights are turning on, right?
But the light changes when you begin the interaction, so when he begins an interaction it applies the previously cached values.
Am I misunderstanding?

1 Like

No, what you said worked fine! Lights are updating in real time, but now they are not turning off.
I guess i called the “completed” to my other bp in a wrong manner, would it be by blueprint interface ?

1 Like

I am, for sure. If I do what OP does in the very first pic, it works very much as expected:

What kind of lights are we talking about? I used default spotlights. I probably did not read the thread carefully enough.

Where in the code are you turning the light off?


In Blue its what you just solved, its working fine now!
In red its just to hide the Widget
In green its to turn the light off

Almost the same as to light but in reverse, settings materials to glass and lights to no visibility

The cheapest way I can think of:

Create a new boolean called “LightsOn” or whatever you like, when you turn the lights on set it to on, when off set it to off.

Make this select node with 1 and 0 (If that messes up your widget then make it 2 and 0), plug lights on to “Pick A” and the output to the Start index of your multigate, here

image

I don’t either, but I don’t know how the interface is triggered and how the input is set up, and I don’t want to send him down a path of no recovery.

1 Like

I guess the light doesn’t turn off because I couldn’t understand how to call the “completed” to my timer handler. It would be by the blueprint interface ?


Thank you guys, I figured out how to turn off.
Its kind a work around, but it did work!




I used the “clear and invalidade” of one to set the other.
Tried some here and seens to work for now!! Thank you guys for your support !
Specialy you SpectreKelevra !

2 Likes

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