Hi, I am currently try to make a 3rd person shooter game. I was wondering how to achieve such zoom without using FOV.
Note: The current zoom of player in the image is 2 after setting the CameraMinZoom = 2.
Something I thought about is to make a script that changes the CameraMaxZoom to be 2 when aiming, then returns it back to something like 15, but that ended by keeping the camera zoom at 2 without zooming out, which requires the player to zoom out manually. How can I achieve that automatically?
Thanks in advance and sorry if I couldn’t clarify well, my English isn’t good.
That actually worked! I guess you forgot to uncomment the last line, thank you!
For anyone who’s looking at this, here’s the corrected form
function setZoom(min,set,max)
player.CameraMinZoomDistance=set
player.CameraMaxZoomDistance=set task.wait(0.1)
player.CameraMinZoomDistance=min
player.CameraMaxZoomDistance=max
end
setZoom(5, 5, 5) -- Zooms in
setZoom(11, 9.5, 11) -- Zooms out
setZoom(4.5, 9.5, 10) -- set it to your custom defaults
The first setZoom will zoom in the camera, the second one will zoom out, and the third will reset to default