How to Offset Player's Camera

Background: I’m playing around with creating the atmosphere for a horror game, and I locked the player’s perspective into 1st person. I also wanted the player’s character to be visible, so I set up a code that sets the legs, arms, and torso’s LocalTransparencyModifier to 0.

However, the 1st person camera is located directly in the middle of the player’s head, meaning that the torso and neck stump are located directly below the camera and slightly in-frame. I want the torso and legs to be visible because the POV would look weird without them.

The question: I was wondering if I could set the player’s camera to be slightly more-forward that the default 1st person POV by about a stud, to put it realistically where their eyes would be.

I tried setting the min-max camera zoom distance to 0.6 to 1 instead of 0.5, but that puts the camera behind the player’s head instead of in front of it. I also tried manually positioning the camera’s CFrame, but it would either reset to the default POV as soon as I move my head, or constantly spin if I tried to set it’s position in a constant loop. Changing the CameraSubject also prevents the player’s character from walking properly.

local runService = game["Run Service"]
local plr = game.Players.LocalPlayer
local stores = {"Right Arm", "Right Leg", "Left Arm", "Left Leg", "Torso"}

runService:BindToRenderStep('Camera', 1000000, function()
	local char = plr.Character
	if char then
		for i, part in char:GetChildren() do
			if table.find(stores, part.Name) then
				part.LocalTransparencyModifier = 0
			end
		end
		
		local camera = workspace.CurrentCamera
		local newFrame = char.Head.CFrame * CFrame.new(Vector3.new(1,1,1))
		camera.CFrame = newFrame
	end
end)

This just makes the camera spin around…

2 Likes


Forgot to include img, this is the view when I look downward just slightly. Makes it look like the camera is located in the player’s brain or something.

have you tried using the humanoid’s CameraOffset property? You might have to change it every frame because it’s relative to the world and not the camera orientation

1 Like

Here is a basic script to offset the players camera

local Player = game.Players.LocalPlayer
local offsetX = 10
local offsetY = 10

Player:CameraOffset + Instance:NewBlockMotion(Vector3.new(offsetX,offsetY,0))

--replace offsetX and offsetY with desired values. This will offset the camera by 10 studs on the X and Y axis respectively

Like @Tom Sssqd said you can use the huanoid’s offset which I am doing here
If you’d like you can make it into a table so you have set offsets

Aauuurrr I didn’t know about the CameraOffset property

local char = script.Parent
local hum = char:WaitForChild("Humanoid")

hum.CameraOffset = Vector3.new(0,0,-1)

A simple script with just these contents placed in StarterCharacterScripts does the job! ty!


new POV looking down

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.