Hi. So i have a scene, and want it to fade over to scene2… I’ve used a 1x1 pixel, and stretched it to fill the screne. The idea was, to increase the opacity to create a fading effect. Right now, it stops fading half way.
This is my code for now.
public Texture2D Fade;
float alphaFadeValue = 0;
void OnGUI() {
GameObject badTrashCan = GameObject.Find("BadTrashCan");
sceneswapone sceneswapone = badTrashCan.GetComponent<sceneswapone>();
if(sceneswapone.timer < 2) {
alphaFadeValue += Time.deltaTime;
GUI.color = new Color(alphaFadeValue, alphaFadeValue, alphaFadeValue, alphaFadeValue);
GUI.Box(new Rect(0, 0, Screen.width, Screen.height), Fade);
}
}