Hi everyone! I’m gonna make alpha of text color alternates between 1 and 0 (text fade in and out). here is the script I made
Text touch;
Color color;
float duration = 1f,b;
void Start(){
touch = GameObject.Find ("TouchToStart").GetComponent<Text>();
color = touch.material.color;
}
void Update(){
b = Mathf.PingPong (Time.time, duration) / duration;
color.a = b;
touch.material.color = color;
}
I have 2 Text GameObjects which are: Title and TouchToStart. When I put the script and play, both Title and TouchToStart starts to alternate alpha instead of just TouchToStart. I don’t get it. please help me. Thank you