How to prevent camera moving when set to custom?

I’m looking to create a mometary freeze in the player’s camera, with the camera being unfrozen when a button is selected. Initially, I changed the player’s camera to scriptable, which freezes it and works fine. However, when I unfreeze the camera and set the camera mode back to custom, the camera flicks back to be perfectly set behind the player instead of in the position it was. I’m looking for the camera to stay in the exact same place, but just have the player be able to move it again.

This video shows the effect I’m talking about:

Code for all the buttons looks something like this:

-- UNPAUSE CHARACTER
Player.Character.Humanoid.WalkSpeed = 16
Player.Character.Humanoid.JumpPower = 50
	
-- UNPAUSE CAMERA
local cam = game.Workspace.CurrentCamera
cam.CameraType = Enum.CameraType.Custom

Is there a way for the camera to just freeze until a player selects an option, with no movement?

Try storing the current camera position and CFrame before locking, then restoring it manually before switching back to custom.

Unfortunately the same thing happens, it seems like no matter where the camera is positioned when it’s scriptable it still moves when set back to custom