Trying to scale a Character properly
Scaling the Character works correctly if the model is anchored, but as soon as you unanchor the model it turns into a blob, which I’m assuming is due to the Motor6Ds not being scaled as well and it retracts back to the Motor6D positions
The rigtype is r6
Code
function AnchorModel(Model, Bool)
for _, Part in pairs(Model:GetChildren()) do
if Part:IsA("BasePart") then
Part.Anchored = Bool
end
end
end
function Scale(Model, Scale) -- loops through model and scales
--AnchorModel(Model, true)
local Primary = Model.PrimaryPart
local PrimaryCFrame = Primary.CFrame
for i, Part in pairs(Model:GetChildren()) do
if Part:IsA("BasePart") then
Part.Size = (Part.Size * Scale) -- scales the part
if Part ~= Primary then
Part.Position = PrimaryCFrame.Position + (Part.Position-PrimaryCFrame.Position)* Scale
-- if the part isnt the primary part scale the position
end
end
end
--AnchorModel(Model, false)
end
local Runs = game:GetService("RunService")
game.Players.PlayerAdded:Connect(function(Player)
while true do
local Char = Player.Character
if Char then
wait(5)
Scale(Char, 2)
end
Runs.Heartbeat:Wait()
end
end)
ScalePlace.rbxl (19.6 KB)
I’ve did research but I couldn’t find any relating to motor6D scaling
Does anyone know how I can scale motor6Ds when I scale the size?
Thanks in advance