Hello, I am creating a character morph when entering the game, and for some reason, the camera is shaking. Does anyone have any ideas about what might be wrong?
local pad = script.Parent
local characterName = "Character"
local character = pad.Parent:WaitForChild(characterName)
local Players = game:GetService("Players")
local function onPlayerAdded(plr)
plr.CharacterAdded:Connect(function(obj)
wait(1.5)
if not obj.Parent then return end
local humanoid = obj:FindFirstChild("Humanoid")
if not humanoid then return end
local charClone = character:Clone()
charClone.Name = plr.Name
plr.Character = charClone
local rootPart = charClone:FindFirstChild("HumanoidRootPart") or charClone:FindFirstChild("Torso")
local plrRoot = obj:FindFirstChild("HumanoidRootPart") or obj:FindFirstChild("Torso")
if rootPart and plrRoot then
rootPart.CFrame = plrRoot.CFrame
end
charClone.Parent = workspace
wait(0.5)
end)
end
Players.PlayerAdded:Connect(onPlayerAdded)