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);
}