Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I resize this welded model?

Asked by
MrMedian 160
6 years ago
function Resize(Model, Scale)
    for i, Part in ipairs(Model:GetChildren()) do
        if Part:IsA('BasePart') and Part ~= Model.Middle then
            local PartCFrame = Part.CFrame
            local Difference = (Part.Position - Model.Middle.Position) * Scale
            local X, Y, Z, R00, R01, R02, R10, R11, R12, R20, R21, R22 = PartCFrame:components()
            Part.Size = Part.Size * Scale
            Part.CFrame = CFrame.new(Model.Middle.Position + Difference) * CFrame.new(0, 0, 0, R00, R01, R02, R10, R11, R12, R20, R21, R22)
        end
    end
end

Resize(script.Parent, 2)

I have a model that is welded together and I want to resize it. I created this script but it only resizes it when it is anchored, since it breaks the welds if it isn't. I can't seem to make it work with welds. How could I edit it so that it changes the weld's C0/C1? Or is there a better way to make it work with welds?

1 answer

Log in to vote
0
Answered by 6 years ago

You can resize models now Make it into a model, then use your resize tool to resize it

0
I know that, but I am trying to resize it in the game, not in studio... MrMedian 160 — 6y
Ad

Answer this question