- Home /
Scaling a mesh moves it up and to the right
I am trying to place one normal sized mesh of a country behind one slightly bigger mesh with a different color, so that it appears as if the original country mesh has a colored border.
However, when I try to do scale a copy of the country mesh, it moves up and to the right instead of having its' center remain in place whilst the mesh itself expands.
The end-result (which I just placed this way by hand so its not very accurate) should be something like this: 
But this does not happen. Instead when I increase the scale of the red mesh to, say, 1.1 (like it is in the picture), like this (done in the red mesh's gameObject):
>> gameObject.transform.localScale += new Vector3(1.1f, 1.1f, 0);
this is the result:

The larger outline is a child of the smaller original but the idea is the same.
Could anyone help me with getting the scaling that I am looking for? Or, if this is simply not how scaling works, are there ways of coloring a mesh's border?
Thanks in advance.
Are you sure the center is moving? Do the coordinates in the inspector change? The mesh might seem to move up and right if the center of the mesh is in the bottom-left.
Also since you're adding 1.1 to localeScale you're not scaling by 1.1, but by 2.1 - hence why your large country is so much bigger than the smaller. You probably want to do a multiplication rather than an addition.
Your answer