I am making a “instructions picture”, where picture should fade out after starting the scene, atm i have made this
using UnityEngine;
using System.Collections;
public class Fade : MonoBehaviour {
float duration = 2;
void Update() {
if (Time.time > duration) {
Destroy (gameObject);
}
}
}
and as you can see, it just destroys itself after 2 seconds, but I want to fade it, for example over 1 second. And if you know how to even make it like in flappy bird used to have, that after touching the screen, it fades out, not after 2 seconds. I hope you undrestand what I mean and I hope you can help me with this simple problem. Thank you for helping!