So I'm making a game and I'm trying to make a zoom happen when you press Q on your keyboard any idea how I can do this?
✓ ANSWER ACCEPTED
How Do You Make a Camera Zoom On a Key Press?
1 answer
✓ Accepted answer
local UserInputService = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
UserInputService.InputBegan:Connect(function(InputKey, GameProcessed)
if (GameProcessed) then return end
if (InputKey.KeyCode == Enum.KeyCode.Q) then
local Camera = workspace.CurrentCamera
Camera.FieldOfView = (Camera.FieldOfView - --[[ZoomDistance]])
end
end)
5 comments
0
It doesn't zoom back to the normal FOV
0
oh wait nvm i can fix it\
1
Don't forget to accept Feahren's answer!
0
Of course it won’t, it wasn’t programmed to.
0
and i fixed that
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Use
UserInputServiceto catch the key press/release and adjust the camera's FOV.I have no idea how to use the "UserinputService"
Please accept my answer. It’s rude to steal my work