lua
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:wait()

local sub

local viewportFrame = script.Parent.ViewportFrame
 
local viewportCamera = Instance.new("Camera")
viewportFrame.CurrentCamera = workspace.CurrentCamera
viewportCamera.Parent = workspace

game:GetService("RunService").RenderStepped:Connect(function()
	if sub then
		sub:Destroy()
	end
	sub = char:Clone()
	for i, v in pairs(sub:GetChildren()) do
		if v:isA("BasePart") then
			v.Anchored = true
		end
	end
	sub.Parent = viewportFrame
end)

i get an error that Sub is nil, I substituted char with baseplate and it worked perfectly, so the fact char is nil is the problem. I don't know what in particular I did wrong

2 comments

0

You cannot clone the character from the start, as its Archivable property is set to False by default

0

Thanks for this even though it's been nearly a year ago :eyes: