Constantly Decrease a Value

I'm trying to make a hunger bar that will constantly decrease over time. I tried to make a code using Huner--, but then it would deplete in 2 seconds and when i tried using WaitForSeconds the health wouldnt go down at all. What can I do to make it work?

var hunger = 100.0; //or any other value;

function Update ()
{
hunger -= Time.deltaTime;
}

It should take around 100 seconds to deplete completly.

Here’s a script that decreases your health (can be hunger) every second, and shows your health in the console:

var Health = 10.00;

function Start () {

 InvokeRepeating("HealthDecrease", 0, 1.0)

}

function HealthDecrease () {

 Health -= 1;

}

function Update () {

 Debug.Log(Health);

}

var hunger = 100.0; //or any other value;
var hungerSpeed = .1;

function Update ()
{
  hunger -= Time.deltaTime * hungerSpeed;
}

here is my way to deal with the integer:

var hungerRaw = 100.0;
var hunger : int;
var speed = 1;
     
function Update ()
{
hungerRaw -= Time.deltaTime * speed;
hunger = hungerRaw;
}

now you use the variable hunger.
This way unity knows that you need an int for hunger (because you defined it) and calculates the closest float to the int number (if that makes any sence :D)