Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Input System Scroll wheel delta?

Discussion in 'Input System' started by TigrisQuasar, Apr 4, 2022.

  1. TigrisQuasar

    TigrisQuasar

    Joined:
    Nov 17, 2018
    Posts:
    3
    Hi everyone I am wondering where did the
    Input.mouseScrollDelta go ? old docs https://docs.unity.cn/ScriptReference/Input-mouseScrollDelta.html

    I could not find anything about it in the new input system. A little guidance on how I could make a delta out of it.

    _inputActions.GameplayActionMap.ZoomCamera.ReadValue<Vector2>().y into the delta.

    Thank you very much. First post no hate please TY<3 :)
     
  2. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Mouse.current.scroll.ReadValue();


    Y is vertical scroll wheel, X is horizontal scroll wheel (if present).
     
  3. TigrisQuasar

    TigrisQuasar

    Joined:
    Nov 17, 2018
    Posts:
    3
    - Thank you it works for my current project! I looked around what works for now is to hard code a 120 divisor although I was looking for something like outputting a normalised either 1 or -1 to be platform-independent without some workarounds.
     
  4. Capgar

    Capgar

    Joined:
    Jul 7, 2017
    Posts:
    2
    Noting here, this command won't work if you are simulating touch events as described below.
    (Window > Analysis > Input Debug > options > simulate touch input from mouse)
    https://www.wafrat.com/simulating-touch-events-in-play-mode-in-unity/
     
    ch_p and viknesh2020 like this.
  5. viknesh2020

    viknesh2020

    Joined:
    Jul 19, 2016
    Posts:
    50
    Thanks for this. I thought my mouse was not working and later found that the touch simulation was ON.
     
  6. ch_p

    ch_p

    Joined:
    May 30, 2017
    Posts:
    3
    Thank you a lot, you are a real savior! I had a problem with the input action `Mouse scroll/y` and there is absolutely no info that this setting destroys this action. That's not a very good design, but still, it is here. Thank you a lot