[quote="Daiz":35yon0z6]For fading the object out smoothly, you could use lerp, that way'd you'll only need two events:
[code:35yon0z6]random(x) -> Set LayerOpacity to 100
If LayerOpacity > 0 -> Set LayerOpacity to lerp(LayerOpacity,0,1-0.0001^TimeDelta)[/code:35yon0z6]
The smaller you make the 0.0001 part the faster the fadeout will be. One another way to speed up the fadeout would be to do this:
[code:35yon0z6]Set LayerOpacity to lerp(LayerOpacity,-100,1-0.0001^TimeDelta)[/code:35yon0z6]
By changing the target opacity from 0 to -100 in the lerp you'll speed up the time required to hit 0.[/quote:35yon0z6]
I get it.. this is much better than the way I was using, thanks !
Just one question, in the part where you said "random(x)", let's say I use "random(10)", does this means that the layer opacity will go to 100 when the random number reaches 9? I don't understand much of the "random" function
Or should I create an event to generate a random number each 1000ms, and then use "if numer = 9 -> set layer opacity to 100" ?
Thanks again, that was really helpful, the way I was doing it was kinda buggy.