Slider widget to change light intensity

Hi, I’m trying to make a widget slider to change a light intensity. I was able to change intensity and color with a button but i cannot do with a slider. I try to set intensity inside the interface graph, but I can’t put my point light like a target, I really don’t know how to do. Anyone could help me?

As the name suggests, Get All returns multiple actors, its icon representing an array. If you want one slider to control all lights, then it’s a fine method if terribly inefficient.

You can run a For Each Loop and fire the event for each actor in the returned array. Create a float input for that custom event and plug the value of the slider there.


Generally speaking, if you feel you need to use a Get All node, in 99% of cases, you’re not approaching things right.

Thank you for your answer… No I don’t want one slider to control all lights but only one…It’s to study and to learn better. Unfortunately I don’t understand very well your solution… I really appreciate if you can show me how can do it. And I’m very thankful for your suggestion about “Get All” node.

You’ll need to explain what your’re trying to do. Not what you’re doing now, but what is the end goal.

Ok… My end goal is to change the intensity light of a single point light with a slider

  • create a widget with a slider
  • create an actor with a light

In the actor:

Image from Gyazo

You can now drag this actor into the level.

Thank you… It works, but when at the start I drag the slider, the light loses intensity…But thank you very much for your help and your time!

Well, of course. :slight_smile: You did not specify how you want it to work…

Ah ok… And I can put a value like the intensity of my spotlight in the first point of the moltiplication float. It’s that the better solution? And why if I put a letter like “T” instead the eventbeginplay, i cannot visualize the slider? Thank you again for your patience!

You’d need to first read the intensity and adjust accordingly, look into Map Range node - it’s perfect for translating 0-1 values into something else.

Do tell if you’re unsure how to do it.

I tried but I could not find a way… Unfortunately I don’t understand that node (I tried with map range clamped to modify but nothing, the light disappear). Moreover like you see from my screenshot I have a level blueprint,

where I can open another interface with “Z” and I able to control button there with keyboard. I would integrate my slider there, or simply call with the same letter the slider. Really thank you for your help you are a very kind person.

You can use MapRange node like so:

The light is initially set to 5000 and the slider to 0.5. That’s assuming you want a 0-10000 range, for example.

Moreover like you see from my
screenshot I have a level
blueprint,alt text where I can open
another interface with “Z” and I able
to control button there with keyboard.
I would integrate my slider there, or
simply call with the same letter the
slider.

Try to avoid doing stuff in the Level Blueprint (LB), there’s usually hardly any need for that. Especially things like input. Input should be in the Player Controller or Pawn. What if you go to level 2, your inputs will stop working and you will need to duplicate all the code for each level… It’s ok if you’re just learning but placing input in actors and level blueprint will make it difficult to debug when things get complicated.

It’s difficult to advise as it’s hard to say what you’re planning on making. If you’re just messing about with the editor to learn the ropes, ignore my naysaying and do not let anyone stop you! :slight_smile:

Really thank you for your advise…It works… I changed some parameter because i wanted that the light doesn’t turn off, but now I understand how it works thanks to you.! alt text Yes it’s only to study and learn and I try to stick with it with some tuto on Youtube and Unreal Academy. Really thank you… Now I will try to implement it and call it in someway to my other Interface in the LP, and after I’ll do it I’ll try to follow your advice about LP! Sorry for my english and thank you again for your patience and to share your knowledge!

Hey, I am currently working on using a slider for every light like you suggested in this comment, but I don´t really get the for loop you mentionned

This is too old for me to remember what was going on. But I must have referred to this:

An array is returned, should you wish to execute something for all actors, use for each loop node.

Sorry to ask about an old subject like that, but i still have issues:
Here is the blueprint inside my actor


Here the one for my widget

and finally inside my level, i want to call the fonction of my actor and for that i used that one:

I realized i got as much widgets produced as my number of actor. I get that it is linked with all my “get all actors of class”, but i don´t find solution to have only one widget displayed, and able to change the lights of all my actors

If you have any clue I would be really thankful :slight_smile:

If the goal is to control many actors with a single widget, create the widget once, at begin play; only then iterate through all actors that need binding.

and finally inside my level,

Since you’re handling the input here, you might as well create the widget here, too. Far from optimal but it could work fine for some non-gaming scenarios.


It could look like this, the actor has a custom event that takes a float ← precisely what the slider spits out. Providing those Signatures (Float Property) match, you can create events like so. Pretty neat.


Do note: pressing M to bind may not be a good idea to start with. If the actors are already in the scene, maybe we should do the whole thing once on Begin Play. Perhaps M should just show / hide the widget instead? Not sure how you envisioned the whole thing.

If the actors are spawned / destroyed, pooled or recycled in some way, a dynamic bind would be a must, ofc.