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
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)