How to set a Random Time for a Flashing Point Light Material?

So I am getting very close to finding what I need for my thunderstorm effect but, I am stuck on trying to figure out how to set the flashing point light material to occur only so often which is how thunderstorms flash here and there and not always, its random and such. Right now it just keeps flashing for some reason even after I set a delay use a function for it.

Any ideas?

Here is one way I tried it below. I also tried following this tutorial here too UE4 : How to use Timers in blueprints of Unreal Engine 4 - YouTube but no luck there either.

Maybe something like this:

This will print Thunder anywhere between 1s and 4s apart, cyclically.
Just remember to give NewTime a default value larger than 0.

Thank you @Everynone

Hmm, interesting, though I’m not quite sure how that will work with the point light but it seems like a good idea so I will give that a try to see how it pans out, thanks!

It’s a Material that is added onto a Point Light as a Light Function.

I am gonna then try making my cloud a bit transparent and have the light move to random points within the cloud. I think that part will use something similar to random coins in a bounds area probably but I just have no idea with the timer thing as it just kept blinking after several tries.

What are you using for the flash now? Point light or material? If it’s supposed to illuminate everything, I’d flash a directional light, maybe.

You could just a timer like I suggested and send a scalar parameter to the material. You could even interpolate it in order to have a control over the curve of the flash. Have several different / random flashes - longer, bigger, brighter.

Essentially a blueprint script that controls how often and how much the material lights up.

Do take your time. Here’s what I mean:

From the top:

  • create a dynamic material and assign it to the light
  • set new time for the event, just in case
  • the timer will fire once between 1s & 4s and loop, new random time between flashes will be applied
  • new random (2-10) brightness level is sent to the material via a param, delay resets it back to 0 after 0.1s
  • you can add a random location here and move the light accordingly

The “material” :wink:

255039-mat.png

Image from Gyazo

Call Stop Flash to make it stop.

Consider it if all else fails.

Good luck!

On the other hand, I don’t think the brightness works with light function like this. It does not override intensity. So you can still set it to 0-1 but crank up the point light Intensity instead. Or simply use light intensity only.

There’s definitely a way of doing it all in material but there’d be less overall control.

Hmm, not sure, I will go look at the unreal docs for that stuff to try to understand it further. I have been struggling to grasp and understand blueprinting/programming stuff. Thank you for the advice and I think I kinda understand a little bit what you mean. I will attempt it further.

Ah okay, thank you.