How do I detect when an object which is scaling over time to a random float, is done scaling?

Hello everyone.

I’ playing around with a Tree controlling system and I’ve visualized the growth part by scaling the tree up like this

        float newScale = Mathf.Lerp(startHeight, finalHeight, Time.time * growthRate);
        transform.localScale = new Vector3(newScale, newScale, newScale);

Now after the tree has grown to the finalHeight which is a Random number:

this.finalHeight = Random.Range(1.2f, 1.8f);

I want to start a Lifecycle function, which is basically just a countdown that destroys the tree at 0.

My question is. How do I determine when the tree is done scaling, when the height is a random height, so that I can set a bool isFullygrown = true, and then do

if(isFullyGrown == true)
        {
            LifeCycle(lifeTime);
        }

The third parameter passed to Lerp is the proportion through ehich the value has been interpolated from its start to end.

So, your tree will finish growing when Time.time * growthRate = 1.0f.
Or, to put it another way, when Time.time = 1.0/growthRate.