Need help replicating world to Viewport Frame

Im trying to clone over the players character to the viewport frame, but for some reason nothing is working. The animations, and changing its humanoid state to the players actual character state to copy there movement doesn’t work. So im wondering if phyisics dont run in Viewport Frames? Im trying to replicate the world but another issue is when you go in first person the world doesn’t match up. Any help would be great! <3

VIDEO

Code:

local viewportFrame = script.Parent.ViewportFrame

local camera = workspace.Camera:Clone()
camera.Parent = viewportFrame
viewportFrame.CurrentCamera = camera

function cloneCharacter(character)
	character.Archivable = true
	local fake = character:Clone()
	character.Archivable = false
	return fake
end

local model = Instance.new("Model", viewportFrame)
for _, object in ipairs(game.Workspace.World:GetChildren()) do
	if object:IsA("Instance") then
		object:Clone().Parent = model
	end
end

repeat wait()
until game.Players.LocalPlayer.Character

local character = cloneCharacter(game.Players.LocalPlayer.Character)
character.Parent = model

local animate = script.Animate:Clone()
if character:FindFirstChild("Animate") then
	for _, object in pairs(character:FindFirstChild("Animate"):GetChildren()) do
		object:Clone().Parent = animate
	end
	character:FindFirstChild("Animate"):Destroy()
end
animate.Parent = character
animate.Disabled = false

game.Players.LocalPlayer.Character.Humanoid.StateChanged:Connect(function()
	print(game.Players.LocalPlayer.Character.Humanoid:GetState())
end)

game:GetService("RunService").RenderStepped:Connect(function()
	camera.CFrame = workspace.Camera.CFrame + Vector3.new(6,0,0)
end)

It only cloned the first CFrame your character was in, it’s not constantly cloning the CFrame. Plus it’d have to clone the character animation too.

At this moment I don’t think there is a solution to being able to have a camera looking at a different point in space within a Frame, and ViewPortFrames are not good for the job because they only render parts that are cloned to it, not terrain, and physics won’t apply.

Someone found this in a post earlier today

That is what got me testing with viewport frames. Thanks for your help.