Trying to make player camera look at a part

Hello guys ! Im having a problem today, im trying to make the player’s camera look at a part.

The script is working BUT the camera is rotating but idk why

here a video to explain my problem

and heres my code

local lookingAt = NPC.HumanoidRootPart

CamMove.OnClientEvent:Connect(function()
	Camera.CameraType = Enum.CameraType.Scriptable
	
	Camera.CFrame = CFrame.lookAt(Camera.CFrame.p, lookingAt.Position)
	
	wait(1)
	
	Camera.CameraType = Enum.CameraType.Custom
end)

if you guys can help me, i’ll really appreciate it, thanks :slight_smile:

Here, you don’t have to set the Camera type to Scriptable

local lookingAt = NPC.HumanoidRootPart

CamMove.OnClientEvent:Connect(function()
	Camera.CFrame = CFrame.lookAt(Camera.CFrame.p, lookingAt.Position)
end)
1 Like

oh yeah, thank you so much for helping me :slight_smile: :heart:

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