Make the camera face the front of the player

Hi, I’ve tried researching, looking at multiple similar forums, but nothing is working. Here is the code, why does the camera always face the same direction regardless of the direction the character is facing? I’m trying to make the camera face the front of the player btw.

		local targetPosition = HRP.Position + Vector3.new(0, 0, -10)
		local CF = CFrame.new(targetPosition, HRP.Position)
		Camera.CFrame = CF
local targetPosition = HRP.CFrame.LookVector*10
local CF = CFrame.new(targetPosition, HRP.Position)
Camera.CFrame = CF

1 Like

This doesn’t work, thanks for the reply though. Here is what happens:

use RunService.RenderStepped or a loop if you wanna make it look forever

if i accidently provided wrong code sorry let me know

1 Like

also probably reverse the arguments?

local targetPosition = HRP.CFrame.LookVector*10
local CF = CFrame.new(HRP.Position, targetPosition)
Camera.CFrame = CF
1 Like

Hmm, the result of this is the same, reversing just made the camera look at the player from the opposite angle. It looks at the player, but not the front no matter what direction the character is facing.

im sorry what is the HRP, is it that grey block or is it the player’s humanoidrootpart

The humanoid root part

local HRP = char:WaitForChild("HumanoidRootPart")

Nevermind! Made it work! Thankyou for your help!

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