Hello! I made a pet who have multiple parts in a model and I would like know how to make grow it with a script.
Couls you help me please?
Hello! I made a pet who have multiple parts in a model and I would like know how to make grow it with a script.
Couls you help me please?
Try to search for “scale model” and you’ll find something like this:
Pretty sure you can model the parts and just scale the model in a script.
Thank for the script but there are a bug: affected parts may have bad orientation so, if you are reading this topic, please use this script instead.
local function ScaleModel(model, scale)
local primary = model.PrimaryPart
local primaryCf = primary.CFrame
for _,v in pairs(model:GetDescendants()) do
local orientation = v.Orientation
if (v:IsA("BasePart")) then
v.Size = (v.Size * scale)
if (v ~= primary) then
v.CFrame = (primaryCf + (primaryCf:inverse() * v.Position * scale))
end
end
v.Orientation = orientation
end
return model
end
Btw just in case you have say a Billboard Gui in the model and use :GetDescendants then it will still try to get the orientation of it which will therefore error so just to stop that you would need to put it like this
if (v:IsA("BasePart")) then
local orientation = v.Orientation
v.Size = (v.Size * scale)
if (v ~= primary) then
v.CFrame = (primaryCf + (primaryCf:inverse() * v.Position * scale))
end
v.Orientation = orientation
end