- Home /
Question by
oliver-jones · Feb 09, 2011 at 08:32 PM ·
cameraplanefadewhite
Having Camera Fade White Over Time
Hello,
I want to be able to have the FP-Controller's camera to fade completely white within 2 seconds. How would I do that/script it? I was thinking of just placing a plane infront of the camera and placing a white material on it and having the ALPHA increase.
What do you recommend?
Thanks
Comment
Best Answer
Answer by Peter G · Feb 09, 2011 at 11:35 PM
Your idea sounds good. You could also use a GUITexture with a 1x1 white square and instantiate that in front of the camera and fade in the alpha.
function FadeWhite (duration : float) {
var i : float = 0;
while (i < duration) {
//alpha += Time.deltaTime/duration
i += Time.deltaTime
yield;
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613103557im_/https://answers.unity.com/themes/thub/images/avi.jpg)