Cloning a Character to a viewportframe is causing all parts in character to dissapear?

function SetViewport(Viewport: ViewportFrame, Rig: Model)
	local Camera = Viewport.CurrentCamera or Instance.new("Camera")
	Camera.Parent = Viewport
	Viewport.CurrentCamera = Camera
	Camera.FieldOfView = 60

	for _, Child in pairs(Viewport:GetChildren()) do
		if Child:IsA("Model") then
			Child:Destroy()
		end
	end

	local CharacterClone = Rig:Clone()
	CharacterClone.Parent = Viewport

	for _, Part in pairs(CharacterClone:GetDescendants()) do
		if Part:IsA("BasePart") then
			Part.Anchored = true
		end
	end

	Camera.CFrame = CharacterClone:GetPivot() * CFrame.new(0, 0, 7)
end

above is my current code. i tried to ensure that everything is anchored but sadly to no avail.
example:
image

would like to note everything is set to archivable=true

solved, added a yield before running the function (streamingenabled was on)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.