How would I go about increasing/decreasing flashlight intensity with the scroll wheel ? I know how to set up the input for the mouse wheel, but I’m just having trouble with mapping out the function for increasing/decreasing the intensity of the flashlight brightness. Below is a picture of the scripting for toggling it on/off. I’m using v 4.18. THANKS AHEAD OF TIME!
Thank you! That’s close but it’s basically just toggling it on and off… Is there a way for it to scroll from 0 to 1000 depending on how much you scroll? Or did I do something wrong?
The example will adjust the value in the increments of 1000 per mouse wheel scroll tick. Try lowering it for more granularity. The default intensity of the Spotlight is 5000 (I think) so I used that as a base here. So 5 scroll downs will switch the light off.
If you require a completely smooth transition, it would require a slightly different approach. A timeline or interpolation.
edit: I’m getting this with increments of 1000:
Not sure what effect you’re after precisely, but you will most likely want to introduce a clamp, too:
Thank you! The last picture works like a charm and is exactly what I was looking for! Thank you for the quick responses and for all your help! I marked your answer.
Hi!
Sorry for bumping this thread, but I am trying to apply the solution you provided above to my own project, and what you suggested seems suitable for what I’m trying to do. What I’m trying to do is to control the light intensity of a bonfire BP with my mouse wheel. The bonfire is from this asset pack:
“M5 VFX Vol2. Fire and Flames(Niagara)”.
To be able to make an object component reference to the point light I want to control (like you did with the spot light in your picture), it is my understanding that I need to apply your solution/code inside the bonfire BP. I tried several places, among others in the level blueprint, but to get it looking like in the picture you posted it seems I have to do it in this BP. I am still at a beginner level in Unreal Engine in many ways.
What I don’t understand, is how you connect the spot light component reference to the intensity float (if I understand correctly what I’m looking at) named “Intensity” in the bottom left corner of the picture. When I try to do it with my point light component object reference, it says “directions are not compatible”. What am I missing? See the embedded screenshot below.
I am using UE 5.3.2.
Thank you!