hello i have made a mini map and i want to be able to when i hover over the minimap it start scrolling ive made the camera scroll the problem is it scrolls my main camera as well how would i go about doing this here is the code for the scrolling so far in c#:
You seem to be editing the main camera's field of view , if this script is attached to the object containing the main camera it will modify it's FoV as well.
You can try defining the minimap camera as either a gameobject from which you will get the camera component , or directly as a Behaviour , and modify the field of view of that camera.
Or you can simply remove this script from your main camera object , if the script is already attached to the minimap camera object.
Another thing i saw is that you are constantly setting the camera field of view every frame in Update()
camera.fieldOfView = 21f;
I wonder how it is functional in the first place.
Another piece of advice regarding zooming in and out.
It is best to use
To avoid the camera zooming in then instantly out when the FoV is equal to the minimum or maximum values , the extra check after incrementing the field of view is for precaution safety measures.