- Home /
Camera's FOV is not changing
I feel like I am missing something very obvious here, but I have a script attached to my camera that has this line in the update loop:
Camera.fieldOfView = 90;
I tried using Camera.main.fieldOfView but that did not work. Help! Thanks!
Any chance that you have the camera set to Orthographic? What value for FOV do you see if view the main camera in the inspector? Are you sure this line of code is being executed (i.e. Debug.Log() next to it)?
Camera.main.fieldOfView is what you want, but the tag on the camera must be "$$anonymous$$ainCamera" for this to work.
Check the tag of your Camera.. This code is only for $$anonymous$$ain Camera in the scene which has a tag $$anonymous$$ain Camera..
Answer by Doireth · Jan 17, 2013 at 08:53 PM
Camera.fieldOfView = 90;
The camera attached to the transform is referenced with "camera" (lower-case c). The upper-case "Camera" pertains to the type class, so it doesn't change a particular object.