How to adjust viewport frame camera?

I’m using @boatbomber’s Viewport open source model for viewport.
Problem: I’m not sure how to change to offset, so that only the upper body parts show.

I want the camera to only show the upper body, not the whole character. What line of code do I need to change?

Currently, it looks like this:
image

And this is the line of code:

-- CF means CFrame.new
local Offset			= cf(0, 1, -6) --6)

CameraUpdater = RunService.Heartbeat:Connect(function()
	if Character.HumanoidRootPart then
		Camera.CFrame =  cf(Character.HumanoidRootPart.CFrame:toWorldSpace(Offset).p, Character.HumanoidRootPart.CFrame.p)
	end
end)

Instead of moving the camera, why not move the character closer to the frame and adjust as necessary so that only the torso is visible?

1 Like