Camera zoom not working

I don’t know what’s wrong with my script.

the issue:
when I press the “F” button I need to be in CameraMaxZoomDistance “0” and the CameraMinZoomDistance “0”. and when I press again the “F” button its need to change to CameraMaxZoomDistance “20” and CameraMinZoomDistance “20”.
now when I press “F” then the CameraMaxZoomDistance “0” and CameraMinZoomDistance “0” is not working. but the CameraMaxZoomDistance “20” and CameraMinZoomDistance “20” work,

https://gyazo.com/9cabca41bf70d8ffda7fe2717af63784

thanks for help :smiley:

Try using:

if not Pressed then Pressed = true
    Player.CameraMode = Enum.CameraMode.LockFirstPerson
elseif Pressed then Pressed = false
    Player.CameraMode = Enum.CameraMode.Classic
    Player.CameraMinZoomDistance = 20; Player.CameraMaxZoomDistance = 20
end
1 Like