Need help with character viewport rotation

hello, i am trying to accomplish a viewport character rotation, I have a script already but isn’t working with no errors. I am not usually a scripter but more of a UI designer sorry this is such a annoying thing to ask :sob:

local vpf = script.Parent:WaitForChild("ViewportFrame")
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
char.Archivable = true

local cam = Instance.new("Camera")
cam.Parent = vpf
vpf.CurrentCamera = cam
local clonedChar
game:GetService("RunService").RenderStepped:Connect(function()
if clonedChar then clonedChar:Destroy() end
clonedChar = char:Clone()
local hrp = clonedChar:WaitForChild("HumanoidRootPart")
	-- heres the part i want to change, i want the character to rotate -- 
	
	-- if would be something like this -- 
	
	--[[
	
local incr = 360/50

-- Rotate the part continually
while true do
	for deg = 0, 360, incr do
		-- Set only the Y axis rotation
		vpf.Rotation = Vector3.new(0, deg, 0)
		
		wait()
	end
end


but it doesnt work, and their is no errors
	]]
	
	cam.CFrame = CFrame.new(hrp.Position + (hrp.CFrame.LookVector * 5), hrp.Position)

	clonedChar.Parent = vpf
end)

Are you saying you want to rotate the object in the viewport? Currently you’re rotating the viewport frame itself.

You should instead rotate the camera around the object. This is much more efficient.

This link could help: How to make camera rotate around model in ViewPort Frame while mantaining set distance and angles - #3 by RuizuKun_Dev