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 = Instance.new("ViewportFrame")
viewportFrame.Size = UDim2.new(0.5, 0, 0.5, 0)
viewportFrame.Position = UDim2.new(0.25, 0, 0.25, 0)
viewportFrame.BackgroundColor3 = Color3.new(0, 0, 0)
viewportFrame.BorderColor3 = Color3.new(0.6, 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 = Instance.new("Camera")
viewportFrame.CurrentCamera = viewportCamera
viewportCamera.Parent = viewportFrame
viewportCamera.CFrame = CFrame.new(Vector3.new(20, 20, 20), charUI:WaitForChild("Humanoid").RootPart.Position)