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?