Search Unity

Windows trackpad scroll not working on unity webgl build

Discussion in 'Windows' started by leisenhuang, Jul 13, 2018.

  1. leisenhuang

    leisenhuang

    Joined:
    Nov 4, 2016
    Posts:
    1
    Hi,

    I found an issue of the unity webgl build on windows edge browser. Input.mouseScrollDelta always return 0 when using the laptop trackpad to scroll. I also tested with the scroll rect and it doesn't work either.

     public Text label;
    public Vector2 mouseScrollWheel;
    private void OnGUI() {
    Debug.Log(Event.current.type);
    if(Event.current.type == EventType.scrollWheel){
    mouseScrollWheel = Event.current.delta;
    }
    else{
    mouseScrollWheel = Vector2.zero;
    }
    }

    // Update is called once per frame
    void Update () {
    label.text = "scroll wheel: " + Input.mouseScrollDelta;
    label.text += " ,ongui scroll wheel: " + mouseScrollWheel;
    }


    I used the above code for testing and both are 0. Any help is appreciated. Thanks
     
  2. A_never_kill

    A_never_kill

    Joined:
    Jan 7, 2014
    Posts:
    81
    same problem
     
  3. arturmandas

    arturmandas

    Joined:
    Sep 29, 2012
    Posts:
    240
    Have you reached a solution?