Flickering/ Fade in and out an image for a storm flash effect unity2d
Hello, Im a relatively new in unity, I´m developing my 2d game...In this moment, I am trying to do a script that can gives random flashes in the whole screen...like a thunder flash in a storm. But i am frustrated because I cant achieve this, my code doesnt work at all and I didnt find any tutorial or any proper explanation in how to achieve this.
I was thinking in a white image with the size of the camera and attached to the camera, and a script in the image gameobject with a random variable that gives a constant loop, to call the "flash" if a certain number appear, or else "wait 15 seconds" until it loops again. I am using C# please, if someone could help me..with some apples xD hehe...I think I have my logic but I am failing at programming this. Thank you very much!
Your answer
![](https://koobas.hobune.stream/wayback/20220612141627im_/https://answers.unity.com/themes/thub/images/avi.jpg)