Changing the size without changing the x position

Hello folks, I’ve got a little problem that is bugging me,

when I change the scaling of an gameobject, (in my case the x scaling) it cuts or adds of both ends of the gameobject, making it appear to wander on the x position (the position stays the same, it just looks that way), is there a way to prevent that?

For example:

my object:                 ||||||||||

now I reduce the size:      ||||||||

and this happens.

I would like it this way:  ||||||||

Is there a way to do that easily?
Thx for any help.

Make a dummy gameObject as parent to your scaling object, and move your scaling object’s localPosition to Vector3(half x scale, 0, 0).

(Make the scaling object’s left align with the dummy object’s center position)

Then change the dummy object’s x scale value, you will see the result you except.

Thanks you 2 =)