Yeah I realized that it was super vague a little too late. Forgot to come back and explain it. Anyway, for anyone else who found this thread this is what it’s doing under the hood:
function adjust(source, height, width, depth, prevHeight, prevWidth, prevDepth)
for _, part in pairs(source:GetChildren()) do
if part.Name ~= "Handle" and part:IsA("BasePart") then --Don't want to touch the handle
local originalSize = Vector3.new(part.Size.X / prevWidth, part.Size.Y / prevHeight, part.Size.Z / prevDepth)
--Get the ORIGINAL size of the previous resizing. On a fresh rig nothing should change.
part.Size = Vector3.new(originalSize.X * width, originalSize.Y * height, originalSize.Z * depth)
--OK, got the original size. Now just scale along the ways that you want it to.
--OK now all the positions are wonky.
--We need to find the current offset of the parts from the root part,
--aka the center, aka... the handle.
local offset = part.Position - source.Handle.Position
--OK that was easy. got the offset. now just need to scale the position
--from the center. Wait... why subtract one? Because the offset is already "one"
--full scale off the center. OK, now just scale the desired width, height, depth etc.
part.Position = part.Position + Vector3.new(offset.X * (width - 1), offset.Y * (height - 1), offset.Z * (depth - 1))
--OK cool, now to go onto the next part.
end
end
end
adjust(source, 5, 3, 2, 1, 1, 1)
--Height to 5, width to 3, depth to 2
--Previous was 1,1,1
wait(2)
--Height to 10, width to 10, depth to 5
adjust(source, 10, 10, 5, 1, 1, 1)
This was assuming you were using WeldConstraints to connect your stuff up I believe. If you edit the position of a part connected by a WeldConstraint it stills sticks to Part0 from the offset you just changed.
OK. Hopefully that clears the air. Thinking about it now, might’ve been nicer to use Vector3’s for the scaling info. Oh well, it still works less than a year later. Let me know if that helped!