Issue:
When setting the camera to Scriptable, the camera’s current zoom position is stored from when it was in Custom. After setting the camera back to Custom, I want to retain the zoom that was set during Scriptable. However, as far as I’m aware, there is currently no function to set the current zoom level of the camera.
Current Solution:
This is the setup I have right now, which is far from ideal. The end result is similar to what I’m aiming for; after running this, the zoom does reset back to the position it was while in Scriptable. However, because this is handled by the core scripts, it includes a tween from its previous position (pre-Scriptable) to the new position, causing the camera to jump back first before going to the new position. If it weren’t for the built in tween, this would work just fine.
local current = { player.CameraMinZoomDistance, player.CameraMaxZoomDistance }
camera.CFrame = CFrame.lookAt(camera.Focus.Position - camera.CFrame.LookVector * to, camera.Focus.Position)
player.CameraMinZoomDistance = to
player.CameraMaxZoomDistance = to
task.defer(function()
player.CameraMinZoomDistance = current[1]
player.CameraMaxZoomDistance = current[2]
end)
Possible Solutions:
Either a way to directly set the zoom level of the camera or a way to disable the tweening behavior of the custom camera would solve this issue.