Switch from Scriptable to Custom camera

I use this easy script to switch from Scriptable camera to Custom, but after switching to Custom camera, it changes the Position of camera.

When I do the same thing in a workspace by my hands, camera after the switch stays on the same place.

I also found that this kind of problem appeared previously, but after updating studio and implementing some solutions from the thread, I still didn’t managed to fix the problem.

How do I fix it?

CameraToDefaultEvent.OnClientEvent:Connect(function()
	
	camera.CameraType = Enum.CameraType.Scriptable	
	
	camera.CFrame = CFrame.new(player.Character.HumanoidRootPart.CFrame.Position - player.Character.HumanoidRootPart.CFrame.LookVector * 12 + Vector3.new(0, 5.4, 0), player.Character.Head.CFrame.Position)
	
	print("changed")
	
	task.wait(3)
	
	camera.CameraType = Enum.CameraType.Custom
	
end)

custom is the default camera type so it will default it back to your characters camera position

I am not sure that this answers my question, unfortunately :frowning:

At first, is still don’t explain why the behaviour of camera in scripting and in workspace ā€œhand-changeā€ differs

At second, for example, you can see the example from provided thread, when camera doesn’t default it back after changing back to custom

the default camera position (as you can see in the video) is behind the players Character which is the default camera positon (the same position as shift lock or first person except not offset in anysort of way). Im not to sure what you mean by ā€œHand-changeā€ since im not sure if your talking about the players arms or actual r15 hands or if you have a custom character.

assuming you cannot see the players character i’d say try orientating their character to match the camera rotation (assuming its not looking down or up either) if it is looking down or up try anchoring their humanoidrootpart assuming they don’t need to move either

i am sorry about the ā€œhand-changeā€, I just meant when you change manually the CameraType

I provided you a video of a bug, it is not how the camera is supposed to work)

a little bit lower you can see that the guy fixed it

I understand that on the video it goes behind the character

and if you read other comments in the thread you can see that is confirmed bug and it was later fixed, so I want also to somehow get rid of this, but I don’t know how