Help with viewport frame cframes

So I made a pet inventory system, and when the pet is shown on the frame, it is extremely small:
Screenshot 2022-02-06 at 4.41.11 PM
See that tiny speck of blue right there? that’s supposed to be a 2x2x2 sized pet.
My script:

local MainFrame = script.Parent
local ScrollingFrame = MainFrame:WaitForChild("ScrollingFrame")
local Info = MainFrame:WaitForChild("Info")
local EquipBTN = Info:WaitForChild("Equip")
local DisplayName = Info:WaitForChild("DisplayPetName")
local InfoViewport = Info:WaitForChild("ViewportFrame")
local temp = ScrollingFrame:WaitForChild("Template")
local RunService = game:GetService("RunService")

local selectedTemp

_G.CreateNewTemplate = function(petName)
	local petModel = game.ReplicatedStorage.Pets:FindFirstChild(petName,true)
	if petModel ~= nil then
		local cloned = petModel:Clone()
		cloned:SetPrimaryPartCFrame(CFrame.new(0,0,0))
		local clonedTemp = temp:Clone()
		clonedTemp.Parent = ScrollingFrame
		clonedTemp.Visible = true
		clonedTemp.Name = petName
		local viewport = clonedTemp.ViewportFrame
		petModel.Parent = viewport
		local viewportCamera = Instance.new("Camera")
		viewportCamera.Parent = viewport
		local cf = cloned:GetPrimaryPartCFrame()

		viewport.CurrentCamera = viewportCamera

		viewportCamera.CFrame = CFrame.new(0,0,cloned.PrimaryPart.Size.Z*2)

		RunService.RenderStepped:Connect(function()
			cloned:SetPrimaryPartCFrame(cf * CFrame.Angles(0,math.rad(3),0))
		end)
	end
end

Please help, any advice is appreciated.

the camera position is far from the objects origin

This is something I use for viewport frames. You may have to invert the “normal” variable.
“handle” is your pet’s hitbox.

if normal == "Front" then
	normal = handle.CFrame.LookVector
elseif normal == "Back" then
	normal = -handle.CFrame.LookVector
elseif normal == "Bottom" then
	normal = -handle.CFrame.UpVector
elseif normal == "Top" then
	normal = handle.CFrame.UpVector
elseif normal == "Right" then
	normal = handle.CFrame.RightVector
elseif normal == "Left" then
	normal = -handle.CFrame.RightVector
end

camera.CFrame = CFrame.new(handle.Position + normal * (-handle.Size.Magnitude/1.5), handle.Position)

Would Module3D work for this? (character limit)

I’m sure there’s an API for that. I’m not familiar with this module, so I can’t really help you.

Edit: Were you talking about this module?
I see you are setting camera’s cframe here, you can just replace it with the cframe calculation I sent you