Hi,
Im trying to resize my shark character model. its a custom model that i’ve made on blender. and is a meshpart. Ideally I’d want to resize the whole character model but from what I read you can’t resize the scale of the character model itself. So i’ve tried to resize the meshpart. However when I resize it in studio and get the correct proportions, the same measurements aren’t proportionate when used in a script to resize the shark.
Essentially I just want to resize the shark proportionally and keep its shape for the player. What would be the best way to do it. Here’s how i’ve gone about it currently.
local sharkModel = character
local scaleFactor = 2 – Desired scaling factor
-- Function to scale CFrame uniformly
local function scaleModel(model, factor)
local primaryPart = model.PrimaryPart -- You need to set a PrimaryPart for the model in the properties
local originalCFrame = primaryPart.CFrame
for _, part in pairs(model:GetChildren()) do
if part:IsA("MeshPart") then
-- Scale the size of each part
part.Size = part.Size * factor
-- Adjust the position of the parts to maintain relative positioning
local relativeCFrame = primaryPart.CFrame:toObjectSpace(part.CFrame)
part.CFrame = originalCFrame * CFrame.new(relativeCFrame.p * factor) * relativeCFrame - relativeCFrame.p
end
end
end