Using viewport frame to show players character

hello, I am trying to test with viewport frames, and im struggling with cloning characters and showing them in the viewport frame. The character is cloned into the gui, however has no children and is therefore not visible, but i’m not sure why this is. this script is in a local script but i’m not quite sure how that would affect it if someone could explain

local viewportFrame ="ViewportFrame")
viewportFrame.Size =, 0, 0.5, 0)
viewportFrame.Position =, 0, 0.25, 0)
viewportFrame.BackgroundColor3 =, 0, 0)
viewportFrame.BorderColor3 =, 0.5, 0.4)
viewportFrame.BorderSizePixel = 0
viewportFrame.BackgroundTransparency = .5
viewportFrame.Parent = script.Parent

local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
char.Archivable = true
local charUI = char:Clone()
char.Archivable = false
charUI.Parent = viewportFrame

local viewportCamera ="Camera")
viewportFrame.CurrentCamera = viewportCamera
viewportCamera.Parent = viewportFrame

viewportCamera.CFrame =, 20, 20), charUI:WaitForChild("Humanoid").RootPart.Position)

Solved the problem, I changed it so that the clone would go into a worldmodel class, this way the character was loaded properly as it says accordingly in the API