Search Unity

Mouse ScrollWheel glitch/bug?

Discussion in 'Linux' started by Satscape, Dec 3, 2018.

  1. Satscape

    Satscape

    Joined:
    Aug 5, 2013
    Posts:
    13
    I'm not sure if this is just the Linux editor or not. In my game the mouse scroll wheel zooms in and out (alters the Camera's field of view). I also have it tied to a couple of keys too.
    When I use the keys in the Unity Editor AND stand-alone, all is well, but if I scroll the mouse wheel in the editor (not stand-alone), I see what looks like frame-rate lag or jerkyness. The frame rates does not drop below 50 though.
    I have this in the .Update()

    zoom -= ( Input.GetAxis ("Mouse ScrollWheel")) * zoomSensitivity;
    zoom = Mathf.Clamp (zoom, zoomMin, zoomMax);

    And to perform the zoom:

    void LateUpdate() {
    GetComponent<Camera>().fieldOfView = Mathf.Lerp (GetComponent<Camera>().fieldOfView, zoom, Time.deltaTime * zoomSpeed);
    }

    IMPORTANT: Even rem'ing out the Mouse ScrollWheel line, still causes the lag inside the editor. It's as if scrolling the mouse wheel and not even reading the value causes this lag, but only inside the Unity Editor.
    In other words, the above code is not running, just the mouse wheel is being scrolled but not read.

    Is this a bug or am I not doing this right?

    Unity 2018.2.18f1 (Ubuntu Linux 18.10)
     
    Last edited: Dec 4, 2018
  2. Parenthephobia

    Parenthephobia

    Joined:
    Mar 11, 2014
    Posts:
    2
    I have this "lag on scroll wheel" issue in 2018.3.0f2 (and a few previous versions - I didn't note the version when I first noticed it).

    Some observations:
    • It happens when using the scroll wheel in the main editor window, whether or not the mouse pointer is in the scene view.
    • Even when only the scene view or game view is visible, it happens.
    • It doesn't happen when zooming in the scene view with alt-right-mouse-button.
    • It doesn't happen when scrolling on any other window - detached "tabs", the about box.
     
    jchambers and Satscape like this.