Author Topic: Camera Control with Slider or Scroll Bar  (Read 2436 times)

mxitwm

  • Guest
Camera Control with Slider or Scroll Bar
« on: August 12, 2013, 07:38:13 AM »
Hello, looking for the best way to move a camera using NGUI's scroll bar. The camera needs to move up and down along the y Axis according to the position of the thumb. Using additional scroll bars I also need to change the camera's rotation on X as well as the depth of field or transform along Z axis. Any ideas or recommended solutions would be appreciated. I am new to Unity and NGUI, busy making my through C# tutorials (due to NGUI) but would appreciate any guidance so I can get this bedded down asap.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Camera Control with Slider or Scroll Bar
« Reply #1 on: August 12, 2013, 03:45:46 PM »
ScrollBar.scrollValue gives you the value in 0-1 range, so just use Mathf.Lerp(minCameraVal, maxCameraVal, scrollBar.scrollValue);