How do I zoom out on a model with viewportframe?

I have a script which toggles viewport on the item/food it is on however it’s extremely zoomed in is there an option to change this?

my script for it is

wait(.3)
local gui = game.Players.LocalPlayer.PlayerGui.ShopGuis.GersonShop
local fram1 = gui.Frame.ShopItemsDisplay.ViewportFrame

local Storage = game.ReplicatedStorage.CameraModels
local Items = Storage:WaitForChild("Foods")

script.Parent.MouseEnter:Connect(function()
	local camera = Instance.new("Camera")
	camera.Parent = script.Parent
	fram1.CurrentCamera = camera
	camera.CFrame = CFrame.new(Vector3.new(0,0,90))
	local item1 = Items.SeaTea:Clone()

	local PCF1 = item1.PrimaryPart.CFrame - item1.PrimaryPart.CFrame.Position


	item1:SetPrimaryPartCFrame(CFrame.new(Vector3.new(0,0,item1.ZPosPreview.Value)) * PCF1)
	item1.Parent = fram1
end)

script.Parent.MouseLeave:Connect(function()
	local item1 = fram1:WaitForChild("SeaTea")
	local camera = script.Parent:WaitForChild("Camera")
	item1:Destroy()
	camera:Destroy()
end)

https://gyazo.com/b836c20ebda5bf248db90e322196fdd5

Help would be appreciated thank you!

Have you tried moving the object closer to the camera? you could also try changing the camera’s FOV

1 Like

How could I make the object closer to the camera?

Changing the position of the object, or changing the camera’s position itself. I usually set up viewport frame cameras by making an object then moving my studio camera to where I want it and duplicating the studio camera and using said duplication so that I know where the camera will be and it’s much easier to figure out where I want it than playing around with position a hundred times.

1 Like

This worked I just changed the fov to 5 thank you!

No problem, good luck with your game!

1 Like