Camera keeps resetting position

Hello, I’m trying to teleport a player and after that change their camera position to hover above a correct angle after they teleport.

The problem is that when I change the CFrame to my desired angle and then switch back to the default camera, the camera starts doing it’s own thing, re-changing the position I have setup for it. It seems to happen when the client moves the camera.

How can I fix this?

-- code sample
function TouchEvents.DoorDoor(hit)
	if not CharacterEngine.DoorDebounce then
		CharacterEngine.DoorDebounce = true
		
		local Root = CharacterEngine.HumanoidRootPart

		local PointSpawn = hit.Parent.Pathway.Value.DoorDoor.CFrame
		local WalkPoint = PointSpawn * CFrame.new(0, 0, -8)
		
		Root.Parent:PivotTo(PointSpawn)
		
		wait(0.25)
		local Humanoid = workspace.CurrentCamera.CameraSubject
		Humanoid:MoveTo(WalkPoint.Position)
		
		wait(0.25)
		workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
		workspace.CurrentCamera.CFrame = Root.Parent.Head.CFrame * CFrame.new(0, 2, 0)
		wait(1)
		workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
		CharacterEngine.DoorDebounce = false
	end
end

I have the same problem right now, did you find the answer?


You need to set the camera to look at the HumanoidRootPart by using CFrame.lookAt

Thanks a lot. By the way the project you’re working on here seems interesting, how’s it coming along?