For each loop create individual parameter

Hello everyone!
I have a big noob question about for each loop and array logical structure.

I would like to be able to control the intensity of a list of lights.
At the moment, I can only set one parameter that controls the intensity of all the lights at the same time, but I’d like the intensity parameter to appear individually for each light.

I can see that I’d have to use the index of each light to create its own parameter, but I can’t figure out how to do it… :smiling_face_with_tear:

Can anyone help me?

Thanks a lot!

You need two arrays, one is the lights, the other is their intensities :slight_smile:

Hey @lawrence.vicare . Here is something you can do. Create a map with first element being the LightActor and second the float. This way when you create a new index, you will automatically have intensity index for it. Later on you can change the float to a different class which can contain many more properties. I have replicated your code for this and images are shared below.

Gif:
217618ce4c6bd55e9d90404649ea2787

Thank you very much guys! :grinning:

It’s almost what I’d like!

In fact, I’d like to be able to add this parameter under each light. That way, if I need to add more other paramaters (like Attenuation Radius or Color for exemple), it’ll be easier, I think.

I have the feeling that the Index output can be used, but I don’t know how :thinking:

As @zer0chi showed above, an array for each parameter.

Thank you :+1:

I’ll try to do that. If I get a good result, I’ll share it here ^^

1 Like