I'm trying to regenerate stamina at a rate of 1 per second using Time.deltaTime, however this doesn't do anything (My 'current stamina' doesn't change at all). I've done some looking around and I have tried Time.fixedDeltaTime. Also tried Time.time, but that just regenerated all my stamina in under a second.
Here is my code:
var max_stamina : int = 100;
var cur_stamina : int;
var staminaRegenRate : int = 1;
function Update(){
//regen
if(cur_stamina < max_stamina){
cur_stamina += staminaRegenRate * Time.deltaTime;
Debug.Log("Second has passed");
}
}
What am I doing wrong?