I’m trying to get a fade out then in on the alpha. Can’t seem to get it. Player will teleport, during the switch screen fades out then in. This is my code but it just fades out… I’m pretty new at this so detailed explanations are appreciated! I have a feeling it has something to do with Mathf.Sin?
void Update () {
panel.GetComponent<Image> ().color = new Color(0,0,0,alpha);
if (alphaTog <= 0) {
alpha += fadeSpeed * Time.deltaTime;
if (alpha == 255f) {
alphaTog = 1;
}
} else if(alphaTog == 1){
alpha -= fadeSpeed * Time.deltaTime;
}