is this a correct way to make an Aim system?

Hi everyone, im completly new in coding but i know some kind of things.
Im working in a FPS type game and i tried to make an aim system clicking the right button of the mouse, its working perfectly (with some little problems clamping the field of view), but im not sure if is the best way. I make this code with everything i know, but i think it can get better. (Im not a english speaker, sorry).
Thanks.
increase and decrease equals 100f;
its always adding and subtracting to the field of view of the camera;

186097-aim.png

ok you may need to go through a few more foundation things before you continue.

I’m assuming that this is running inside of a loop, this will make the value zoom ALWAYS either true or false

which means each time your program runs through the loop its going to be either executing the if(zoom) code or the else code beneath it. this can work if you want the view to automatically return to normal after the button is released, however you will need to set a limit on the “zoom out”, something like

if(!zoom && fieldOfViewf >= defaultFOV)
should help with that.

that being said, just run through a few unity tutorials to help you with the “flow” of coding in unity