- Home /
Changing zoom speed?
so far iv got if (Input.GetAxis("Mouse ScrollWheel")> 0){
Camera.main.fieldOfView = fov --;
}
if (Input.GetAxis("Mouse ScrollWheel")< 0){
Camera.main.fieldOfView = fov ++; what i want is for the fov to zoom in/out faster? iv tried fov - 2 -- but that doesn't get me the results i want any help?
Comment
Answer by Berenger · Feb 08, 2012 at 09:55 PM
First, it should be connected to the speed of your application, so everyone get the same effect. For that, use Time.deltaTime. To increase how fast you can scroll, use a variable with a cool name like scrollSpeed or anything you like. Then :
if( scroll up ) zoom += Time.deltaTime * scrollSpeed;
else if( scroll down ) zoom -= Time.deltaTime * scrollSpeed;