UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a decreasing health bar"
public class HealthBar : MonoBehaviour { Image healthBar; float maxHealth =79f; public static float health; void Start () { healthBar = GetComponent<Image> (); health = maxHealth; } void Update () { healthBar.fillAmount = health / maxHealth; } }