Why doesn't this work to scale my object?

I wrote this line according to some examples I found and it doesn’t seem to be working can anyone help me fix it?

test1clone.transform.localScale(new Vector3(-0.1, 0.1, 0.1), Space.Self);

Right now this is what i’m trying to run I want the object “test1clone” to shrink to a tenth of its size in every axis

Try it like this.

transform.localScale = new Vector3 (0.1f, 0.1f, 0.1f);

If you want it to shrink that much on each update do it like:

transform.localScale -= new Vector3 (0.1f, 0.1f, 0.1f);
1 Like

We are assuming the original objects scale is 1x1x1.

test1clone.transform.localScale = new Vector3 (0.1f, 0.1f, 0.1f); //this would be 1/10 scale

test1clone.transform.localScale = original.transform.localScale * 0.1f; //not tested , More flexible code to get 1/10 scale
1 Like

Good catch there. I didn’t even consider the possibility of it not being a 1x1x1 to start with.

1 Like

Thanks a lot for your help this worked perfectly