Making the player face a part (or position) in First Person

I’m basically trying to make the player face a part while being in first person.
The issue is that all I have tried only works in Third Person, and not First Person.
I’ve already looked at several pages on the Dev Forum, but again, only works using Third Person.

This Lua script here, was an attempt (or a test).
The while loop is supposed to spin the player’s character around with the camera. But since the player is in First Person, it’s like nothing is happening.
Obviously this doesn’t have anything to do with trying to face the player’s camera to a part. But currently im just trying to figure out how to move the player’s camera (in First Person).

garageDoor.closeHitbox.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		if isUp then
			door.Parent.ClosedCollision.CanCollide = true -- this is the part
			
			--move garagedoor
			move("down", 0.5)
			
			--spin test
			while task.wait() do
				local character = hit.Parent
				local root = character:FindFirstChild("HumanoidRootPart")
				root.CFrame = root.CFrame * CFrame.Angles(0,2,0)
			end
		end
	end
end)
1 Like
workspace.CurrentCamera.CFrame = CFrame.new(workspace.CurrentCamera.CFrame.Position) * CFrame.Angles(rX, rY, rZ)

where rX, rY and rZ are rotation values in radians, and the thing is running in a localscript

Or to directly make it look at a position:

workspace.CurrentCamera.CFrame = CFrame.lookAt(workspace.CurrentCamera.CFrame.Position, [position you want to rotate to])
1 Like

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