Can't get Lerp to return linear movement instead of smoothed

I’m trying to create a linear fall off but can’t seem to get it to work. I either end up with a smoothed fall off or an instant one. This is for updating a health bar so it looks like health is draining away.

What I’m currently trying is

    // Use this for initialization
    void Start () {
        fgBar = transform.FindChild("HealthBarFG").gameObject;
        startTime = Time.time;
    }
   
    // Update is called once per frame
    void LateUpdate () {
        float hp = ((float)pState.Health)/((float)pState.MaxHealth);       
        float tarHp = Mathf.Lerp(1, hp, (Time.time - startTime) * HealthSpeed);
       
        fgBar.renderer.material.SetFloat("_Progress", tarHp);
    }

But this causes tarHP to instantly jump to hp’s value. I’ve tried all sorts of values for HealthSpeed, though I’m currently using 1. What am I missing here?

Lerp’s third value (the “alpha”) is only from 0 to 1 (floating point). Not sure what your HealthSpeed is here, but in any case it will only be multiplied by larger and larger values as Time.time moves further from startTime. I don’t think you want that.

If you give an alpha less than zero you get the first Lerp term, an alpha greater than one and you get the last search term. It only returns values between the first and second arguements.

I think it is. If you go to Google and enter “y = x * 10” you’ll get a linear growth function. That means the alpha value is growing linearly over time. That’s exactly what I want assuming Lerp works the way you’ve described it. Unfortunately, it doesn’t appear to be working that way.

edit: I found that the issue was where I was setting startTime. It needed a way to get reinitialized so when the player’s heath changed, the time difference wasn’t already massive.