|
I need a full script that can flash a light at random intervals for lightning simple as that
(comments are locked)
|
|
This is a real quick idea, you'll want to play with the numbers, but you should get the ideas. Attach to a DirectionalLight I would think.
thresh is the minimum threshold between 0 and 1 that a random number must exceed to turn the light on. minTime is the minimum time interval to check that random number. A more realistic effect might have a 'strike check' time (between 'strikes') and each strike would be 'on' for some small amount of time, during which rapid flashing would take place. I'll leave that to you. Here are some more ideas: http://answers.unity3d.com/questions/14505/lightning-with-random-intervals
Jan 15 '11 at 01:41 AM
DaveA
You are my hero...works flawlessly :)
Jan 15 '11 at 08:14 PM
user-7337 (google)
How memory intensive, is this approach? As in toggling enabling this fast, this often? And creds for provindg a full script to the poster.
Feb 05 at 08:55 PM
Deeweext
It should take about zero memory. It's just enabling/disabling the light, with a tiny amount of script. It should be able to do this once per frame, so depends on your setup, 100/second?
Feb 08 at 11:26 PM
DaveA
(comments are locked)
|
