i want to make the camera rotate around the model in the viewportframe
how can i implement it inside here
local zoomOut = 4.5
local VPF = script.Parent:WaitForChild("ViewportFrame")
local player = game.Players.LocalPlayer
function render(object)
local cam = Instance.new("Camera")
object.Archivable = true
local clone = object:Clone()
clone.Parent = VPF
local cam = Instance.new("Camera")
cam.Parent = VPF
pcall(function()
if object:IsA("Model") and object.Humanoid and object.Hitbox then
cam.CFrame = CFrame.new(clone["Hitbox"].Position + (clone:WaitForChild("Hitbox").CFrame.lookVector * zoomOut) + Vector3.new(0,0,0), clone.Hitbox.Position)
elseif object:IsA("MeshPart") then
cam.CFrame = CFrame.new(clone.Position + (clone.CFrame.lookVector * zoomOut) + Vector3.new(0,1,0), clone.Position)
end
end)
VPF.CurrentCamera = cam
end
function ResetVPF()
VPF:ClearAllChildren()
VPF.CurrentCamera = nil -- nil is equal to nothing
end
render(game.ReplicatedStorage.Pets.Ctulu)