How would I resize this welded model?
01 | function Resize(Model, Scale) |
02 | for i, Part in ipairs (Model:GetChildren()) do |
03 | if Part:IsA( 'BasePart' ) and Part ~ = Model.Middle then |
04 | local PartCFrame = Part.CFrame |
05 | local Difference = (Part.Position - Model.Middle.Position) * Scale |
06 | local X, Y, Z, R 00 , R 01 , R 02 , R 10 , R 11 , R 12 , R 20 , R 21 , R 22 = PartCFrame:components() |
07 | Part.Size = Part.Size * Scale |
08 | Part.CFrame = CFrame.new(Model.Middle.Position + Difference) * CFrame.new( 0 , 0 , 0 , R 00 , R 01 , R 02 , R 10 , R 11 , R 12 , R 20 , R 21 , R 22 ) |
13 | 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?