Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Input.mouseScrollDelta - what is it?

Discussion in 'Documentation' started by andyz, Jan 10, 2015.

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,285
  2. Rasmus Selsmark

    Rasmus Selsmark

    Joined:
    Mar 13, 2013
    Posts:
    120
    E.g. the unit of the wheel delta?
     
  3. Summit_Peak

    Summit_Peak

    Joined:
    Nov 15, 2014
    Posts:
    3
    Code (CSharp):
    1.     public static float ScrollWheel { get { return Input.GetAxis("Mouse ScrollWheel"); } }
    2.     public static float ScrollWheel { get { return Input.mouseScrollDelta.y / 10; } }
    Both methods return the same value, but the second method is slightly more efficient.