When resizing in studio with the draggers, you can resize up or down on y, like shown below:
when trying to increase that same part’s size through command line while adding 1 on y again, it grows on both sides:
how would I make a script that resizes parts like in studio? (keeps them in place while resizing, and can increase down or up (side to side) etc. (like in the first video))
Yes this requires cframing. Basically it should look something like this
function scaleTransformation (part, scale) -- This is whatever the transformation you are trying to apply, it is a vector 3 value.
part.Size = part.Size+scale
part.CFrame = part.CFrame*CFrame.new(-scale/2)
end
I’m kinda making a rushed piece of code, but the point is that the line
part.CFrame = part.CFrame*CFrame.new(-scale/2)
Repositions the part so it will keep one of the faces in place by moving it to the direction of the scale, however by half the magnitude of the scale.
However, the problem here is that only doing this will only fix the scaling for once face, This is a good start to understand what to do. I apologize for only answering half of your question. I don’t have access to studio and I don’t want to risk misleading you.
1 Like