x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 https://www.youtube.com/watch?v=QcN04l3Vlxk but no luck there either.

alt text

Product Version: UE 4.20
Tags:
more ▼

asked Sep 28 '18 at 09:32 PM in Blueprint Scripting

avatar image

Deygus
113 13 21 21

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Maybe something like this:

alt text

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

capture.png (77.8 kB)
more ▼

answered Sep 28 '18 at 10:20 PM

avatar image

Everynone
12.5k 71 24 51

avatar image Deygus Sep 29 '18 at 04:18 PM

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!

avatar image Everynone Sep 29 '18 at 04:23 PM

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.

avatar image Deygus Sep 29 '18 at 04:32 PM

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.

alt text

avatar image Everynone Sep 29 '18 at 04:38 PM

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.

avatar image Deygus Sep 29 '18 at 04:41 PM

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.

avatar image Everynone Sep 29 '18 at 04:56 PM

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

alt text

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" ;)

alt text

Image from Gyazo

Call Stop Flash to make it stop.

Consider it if all else fails.

Good luck!

graph.png (278.5 kB)
mat.png (31.4 kB)
avatar image Everynone Sep 29 '18 at 05:07 PM

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.

avatar image Deygus Sep 29 '18 at 05:09 PM

Ah okay, thank you.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question