Turn off and reset original light intensity

Hi all.
Sorry if this may be a stupid question (I have no solid skill with bp).
What I’m trying to do is to trigger multiple groups of lights at once through trigger event in sequencer.
For each group of light I made a turn off and a turn on event. Now I’m trying to make the turning on event able to reset the original intensity of each individual light (many different settings).

Here’s my failed attempt.

First event is “lightsOff” so it takes current light intensity and stores it in a variable (originalIntensity), then it multiplies by 0; after this “lightsOn” should take “originalIntensity” and it should make it the new intensity… but it stays turned off.

Thank you in advance.

Instead of changing intensity, which not just use ‘hidden in game’ :slight_smile:

I’ll try this, thank you.
Anyway can you help me understand why it’s not working with set intensity?
Also, how can I gradually bring intensity up instead of on/off?
I can’t use timeline node in sequencer…

Yes. It’s not working because you haven’t stored the original intensity anywhere.

You are setting a variable called ‘original intensity’, but it’s the same variable for all the lights.

If you want to do it your way, you either need an array of floats to store the original values, or, make the lights into blueprints.

If you make them BPs, you can hold the original setting in the blueprint, and go back to it later.

I see it now. Thank you. I’ll try to make the array thing :slight_smile:

1 Like

Ok, I’m lost.
First I’ve tried the array but with no luck (=no competence, I know).
Then I’ve tried the bp way.
So I made “BP_spotLight1” (image in two parts):


Then in the sequencer I made this for each group of lights (which have the 1 or 2 or 3 actor tag), so 3 lightsOff and 3 lightsOn.

Now, I believe it’s the same thing, so it takes the value one time for all the object but I don’t really understand how to make it work.

Hope I’ve been clear.
Thank you (or anyone else is trying to help me) again.

You’re fighting a losing battle, trying to control all the lights from one place.

It’s much better to write one light correctly, then you hardly have to do anything.

The code in the light is

You can make the intensity different for each light, by making it instance editable ( visible in the level )

image

Then, from the level BP, you can say

If you learn about dispatchers, you can make it even more efficient.

xD I knew it were all wrong. I was playing by the ear without any proper knowledge of blueprint.
I’ll try this.
Thank you again.

1 Like

Tell me how it goes :slight_smile:

It worked :smiley:
Now I have to deal with other issue but nothing related to BP. I’ll make another topic if I’m not able to find a fix.

I appreciated your help immensely.

1 Like

Sorry for catching this topic up again XD
It’s for a similar thing.
I’m trying to make another custom event after lightsOn and Off which is something that pump up o down the emissive color of a mesh.
I’ve replaced the previous mesh with a blueprint one.
This is the construction graph:

…and the event graph:
image

This is the sequencer blueprint updated (last 3 nodes for each event):

If I select the bp mesh and manually trigger the on or off event, it looks like it’s not working but if I move even slightly the mesh it appears as if the event actually worked. :frowning:

What am I doing wrong??

You have a horrendous loop within a loop thing there

But apart from that, I’d say you’re problem is the construction script is only called when the actor is placed. If you want the effect again, you have to run that code again, so you’ll need to connect it to an event and call it :wink:

Ok! Everything is working now.
So the script in the construction graph is unnecessary?
Anyway, can you suggest a good course for blueprint? I’ve attended more than one but something is missing (I’m a 3d artist, not a programmer so I guess I lack some basic knowledge).

Thank you as always.

If you want to drop it in the level, and tweak the emissive color, that’s the construction script.

Then, if you ALSO want to do that at run time, then you need the same code connected to an event in the event graph.

For the BP, you need to run the second loops AFTER the first one like this

At the moment, you’re running them for EVERY time around the first loop :slight_smile:

1 Like