Im trying to decrease over time a health script for learning purposes but everytime i run it it decreases completely in seconds i just wanted to know mainly how to use time.deltaTtime correct or lose the update function tried many ways going for simplicity any help please…heres what i have i want it to reduce by the second rather than the frame
using UnityEngine;
using System.Collections;
public class Health : MonoBehaviour {
public float health = 100;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
while (health > 1) {
health -= Time.deltaTime;
print (health);
}
}
}