Dear scripters, as we know from the basics, we can change a part's size by changing the size property. Let's say I have
part.Size = Vector3.new(10,2,5)
then,
part.Size = Vector3.new(20,2,5)
will elongate my part by 10 units on the X dimension.
The problem with this approach is that the part's position will also change and will be out of alignment with the old one. How can one change the size, for example elongating/stretching a brick, while maintaining alignment?
Here is a pic in order to make my point clearer visually: https://imgur.com/a/SaRS7Ty
Of course, I am here as I am looking for a programmatic solution; this is an easy task using the studio interface.

5 comments
Get and store the current position. Resize. Set the position to the stored position. Profit?!
That's what I don't want. With reference to the attached picture, it will center the parts rather than align them... unless I have misunderstood your comment?
Your part gets elongated by 10 on the X, now elongate the Z axis by 5.
Oh, my bad, haha. I misread your question. I guess you can try adding half the difference between the sizes. If you grow the part by Vector3.new(5,0,0), you'll displace it by Vector3.new(2.5,0,0). I THINK that should work fine.
This would only apply to growth on the positive direction of the axes. You'd have to displace with negative vectors if the growth is towards the negative direction.