Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Trollvahkiin on July 28, 2014, 04:19:47 PM

Title: How could I make a FOV slider for a camera?
Post by: Trollvahkiin on July 28, 2014, 04:19:47 PM
Hey, so I've been doing the options menu and I went on to do the fov slider which I thought I could just use the sliders but I noticed I can't seem to change the start and end values on them. Meaning the fov can only be picked from 0-100. Also how could I simply link the slider to the camera. I thought of just dragging the camera into the on value change but no result.
Title: Re: How could I make a FOV slider for a camera?
Post by: ArenMook on July 29, 2014, 03:25:36 AM
You can use sliders just fine.
  1. camera.fieldOfView = Mathf.Lerp(min, max, slider.value);
where 'min' is the minimum value and 'max' is the maximum value, such as 30 and 60 to have FOV between 30 and 60 degrees.