Smooth Scaling of an Object

Hi, I’m trying to smooth scale my object by using zoom;

So everytime I scroll up / zoom in it will become bigger and vice versa.

For now I’m using this code

          for(GameObject child in listDraw)
            {
                float onChangeZoom1 = currentZoom - originZoom
                if (currentZoom != originZoom)
                {
                     child.transform.localScale = child.transform.localScale * 
                     Mathf.Pow(2, onChangeZoom1);
                     originZoom = currentZoom;              
                }
            }

I tried using the Lerp or MoveTowards function, but it never did scale the object.

            if(currentZoom > originZoom)
            child.transform.localScale = Vector3.Lerp(child.transform.localScale, 
            child.transform.localScale * 2, Time.deltaTime * .02f);
            else
            child.transform.localScale = Vector3.Lerp(child.transform.localScale, 
            child.transform.localScale / 2, Time.deltaTime * .02f);

Any way to solve this?

Are you sure that this is actually not doing anything? Did you really check the numerical values of the scale if they changed?

Because from your code (second version) this should work. However the change each frame would be really really small. So from a visual perspective probably nothing changed. You current code (still the second version) would only increase by 2% over 1 second IF you were constantly scrolling for the complete second. So the thing you should check first is to remove the factor 0.02f from your Lerp statements.