Search Unity

Mouse Scroll not responsive

Discussion in 'Scripting' started by Subliminalman, Apr 26, 2017.

  1. Subliminalman

    Subliminalman

    Joined:
    Sep 11, 2012
    Posts:
    47
    I'm trying to use the scroll wheel to replicate the zoom effect that the scene view uses.

    I've tried multiple solutions but all of them are very unresponsive which is confusing since Unity is very responsive within the scene view.

    Here's some of the code that I have attempted but all of them will be generally unresponsive mostly return 0.

    Code (CSharp):
    1. if (Input.mouseScrollDelta.y > 0) {
    2.             transform.position += cam.transform.forward * speed * Time.deltaTime;
    3.         } else if (Input.mouseScrollDelta.y < 0) {
    4.             transform.position -= cam.transform.forward * speed * Time.deltaTime;
    5.         }
    6.  
    Code (CSharp):
    1.  
    2. Debug.Log(Input.GetAxis("Mouse ScrollWheel"));
    3.