Ok I’ll try and explain my problem again.
I’m using a 3D light and I want it to randomly blink (like a broken neon).
So I need the light to have 2 states :
– Normal state, the light stays on
– Blink state, the light blinks randomly
In the code provided the “fuse” variable sets the state of the light. But I just can’t find a way to create the variable at code runtime.
Any clue ?
if (time == 0) {
fuse = 0;
}
level = 270;
amp = 100;
if (random() > 0.9 && fuse ==0) {
fuse = 1;
}
if (random() > 0.5 && fuse ==1) {
fuse = 0;
}
if (fuse == 1) {
noise(time*10) * amp + level-amp;
} else {
level;
}