Author Topic: How could I make a FOV slider for a camera?  (Read 3456 times)

Trollvahkiin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
How could I make a FOV slider for a camera?
« 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How could I make a FOV slider for a camera?
« Reply #1 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.