Hey there!
I am currently trying to make a simulation of our solar system in Unity. Right now I am dealing with the nametags for the planets. I got the text to follow the planet!
My question: Is it possible to make that text fade out when I zoom in close to my planet. And fade it in when I am far away.
This is the code I currently have for the text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PlanetTag : MonoBehaviour
{
public Text nameLable;
// Update is called once per frame
void Update()
{
Vector3 namePose = Camera.main.WorldToScreenPoint(this.transform.position);
nameLable.transform.position = namePose;
}
}
How would I go about implementing this fade system?