ok so im new to C# and needing help i want to send my health information to my ui text…and not sure were to start here is my code
public class TestHealth : MonoBehaviour{
public int Health = 100;
void OnTriggerEnter(Collider col)
{
// set at 4 hits = a kill
if ((col.gameObject.tag == "AstroidTag"))
{
Health = Health - 25;
Destroy(col.gameObject);
}
// set to 3 hits = a KILL
if ((col.gameObject.tag == "Bullet"))
{
Health = Health - 35;
}
// Health Pack = 100
if ((col.gameObject.tag == "Health"))
{
Health = Health = 100;
}
if (Health <= 1)
Destroy(gameObject);
if (Health >= 100)
Health = 100;
}
}