When changing from First Person camera to Third Person camera via Player.CameraMode, the camera remains fully zoomed in instead of returning to its original zoom.
To get back to the original 3rd person camera zoom, I am doing:
--Just before player enters first person mode
local zoomLevel = (workspace.CurrentCamera.CFrame.Position - workspace.CurrentCamera.Focus.Position).magnitude
--...
--Sometime later when player is returning to third person mode
game.Players.LocalPlayer.CameraMinZoomDistance = zoomLevel
If the player’s camera is occluded before entering first person mode, then zoomLevel’s value is the occlusion zoom distance, not the true Camera.Zoom value. Since we cannot access Camera.Zoom, how can I reset the 3rd person camera to the user’s previous camera zoom distance?
This is only a problem when DevCameraOcclusionMode is set to Zoom, which is probably the desired setting for most games.
This is becoming an issue because the player tends to switch to first person upon entering a small space and then switches back to 3rd person upon leaving the small space, but if the player Camera has been occluded, then the new 3rd person camera view is nearly on top of the player and requires a scroll-out, which clearly aggravates playtesters.
Thanks in advance for the help!