- Home /
Java script Field of view
Hi. I'm using java script to create my game and i want to change the field of view in order to give the impression of zooming in.
var Normal_FOV = 90.0; var Scoped_FOV = 45;
function Update () { if (input.GetButton("0")){ if (main.camera(FOV = Normal_FOV)){ main.Camera(FOV = Scoped_FOV) } else if (main.camera(FOV = Scoped_FOV)){ main.camera(FOV = Normal_FOV) } } }
This is the code I created but i dont think the FOV works. what is the correct term for Field Of View
Answer by Jessy · Oct 07, 2010 at 07:58 PM
http://unity3d.com/support/documentation/ScriptReference/Camera-fieldOfView.html
That said, there is next to nothing about your code is syntactically correct for any of the languages used with Unity.
Answer by skovacs1 · Oct 07, 2010 at 08:00 PM
field of view is Camera.fieldOfView. When in doubt about functions, variables, classes, etc., check the script reference.
You might find this question relevant. You should really search before asking for help.
Your answer
Follow this Question
Related Questions
Sniper Zooming 2 Answers
Mouse-Scroll Zoom 1 Answer
Add MaxFOV to zoom script? 0 Answers
how to know the relationship between zoom ratio and field of view 1 Answer
Zooming camera using move z position. 0 Answers