I am not able to alter size and CFrame of clonedCharacter.
Here’s the script:
local function ClonePlayer()
for _, player in pairs(game:GetService("Players"):GetPlayers()) do
if table.find(Table_Win, player.Name) == 1 then
local character = player.Character or player.CharacterAdded:Wait()
if character then
character.Archivable = true
local clonedCharacter = character:Clone()
clonedCharacter.Archivable = false
clonedCharacter.Parent = workspace
clonedCharacter.PrimaryPart.Size = Vector3.new(43.422, 43.422, 43.422)
local scaleFactor = 100
for _, part in pairs(clonedCharacter:GetChildren()) do
if part:IsA("BasePart") or part:IsA("MeshPart") or part:IsA("Part") then
part.Size = part.Size * scaleFactor
end
end
clonedCharacter.PrimaryPart:PivotTo(CFrame.new(-54.027, 115.786, -112.663))
end
end
end
end
What I’ve noticed is that if I change size of all Character parts in the iterating for loop to desired Vector3.new(43.422, 43.422, 43.422), it will alter the position as well and cause deformation in Cloned object. Another thing I’ve noticed is that if each part position in the for loop is changed to CFrame.new(-54.027, 115.786, -112.663)), it will make the Cloned object look like a square shape.
Fortunately I have a module that scales characters.
return function(character:Model, scale:number)
assert(character and character:IsA("Model"), `Model expected for character, got {typeof(character)}`)
assert(scale and typeof(scale) == "number", `Number expected for scale, got {typeof(scale)}`)
--// Rescaling character
local kCharacterScale = character:GetAttribute("KCharacterScale")
local diff = scale / (kCharacterScale or 1)
for _, v in character:GetDescendants() do
if v:IsA("BasePart") then
v.Size *= diff
elseif v:IsA("JointInstance") then
v.C0 -= v.C0.Position * (1 - diff)
v.C1 -= v.C1.Position * (1 - diff)
elseif v:IsA("SpecialMesh") and v.MeshType == Enum.MeshType.FileMesh then
v.Scale *= diff
end
end
end
The scale is basically the percentage of how much bigger/smaller you want the character to be, with 1 being 100% (no change). So if you want the character to double in size you put 2.
If that doesn’t work, then there’s an issue with cloning the character.