I am wanting to scale a model down, however can’t do so easily.
I’ve tried scaling each part of the model, but it ruins stuff, as seen below with a sign.
Since I scale the sign part and pole part, they get scaled from their centres, and thus become disjointed.
Original Sign model
ClonedItem.Anchored = false
ClonedItem.CanCollide = false
ClonedItem.CanTouch = false
ClonedItem.Size *= 0.25
if #ClonedItem:GetChildren() > 0 then -- Parts inside the part
for _, part in pairs(ClonedItem:GetChildren()) do
if not part:IsA("BasePart") and not part:IsA("MeshPart") and not part:IsA("UnionOperation") then continue end
part.Anchored = false
part.CanCollide = false
part.CanTouch = false
part.Size *= 0.25
local Weld = Instance.new("WeldConstraint")
Weld.Part0 = ClonedItem
Weld.Part1 = part
Weld.Parent = ClonedItem
end
end
My game uses this function, but I don’t know how it works because I stole it from someone on DevForum LOL
If someone can explain what :lerp is without sending me the documentation website that I don’t understand that’d be appreciated <3
-- Don't forget to add a PrimaryPart!!!!!
function resizeModel(model,a)
local base = model.PrimaryPart.Position
for _,part in pairs(model:GetDescendants()) do
if part:IsA("BasePart") then
part.Position = base:Lerp(part.Position,a)
part.Size *= a
end
end
end
resizeModel(workspace.Model,1/2) --> sizes to 1/2
Problem with it is my objects are stored like this:
‘ClonedItem’ is the ‘Root’ part here. I only clone the Rootpart of the model to hold, as the model itself contains several other parts not needed when holding the item
EDIT Nvm, just reworked my code to allow this to work