Search Unity

Mousewheel problems...

Discussion in 'Scripting' started by HighStakes5000, Nov 14, 2009.

  1. HighStakes5000

    HighStakes5000

    Joined:
    Nov 12, 2009
    Posts:
    10
    Hello, I am having problems with a mousewheel zoom type of effect as many others are.

    My main question is: What do I type into the "positive direction" in the input manager under "Mouse ScrollWheel"? I couldn't find this anywhere... whenever I type something in it just disapears. Thanks
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    There isn't a "positive direction", and you don't type anything. There's "positive button", which is for keys, not axes. Some zooming code (from Fractscape):

    Code (csharp):
    1. zPosition += Input.GetAxis("Mouse ScrollWheel") * wheelZoomSpeed;
    --Eric
     
  3. HighStakes5000

    HighStakes5000

    Joined:
    Nov 12, 2009
    Posts:
    10
    Thanks for the reply -- But I'm still having this problem (It's probably easily fixed). Here is my code:
    Code (csharp):
    1. distance -= (Input.GetAxis("Mouse ScrollWhell") * Time.deltaTime) * zoomrate * Mathf.Abs (distance);
    and I get the error "UnityException: Input Axis Mouse ScrollWhell is not setup.
    To change the input settings use: Edit -> Project Settings -> Input

    CamMove.LateUpdate () (at Assets\CamMove.js:40)"

    and it doesn't work (I'm trying to set up a zoom feature with the mouse wheel). Any other ideas?
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Typo in code...take another look at the name you're using for the axis. ;)

    --Eric
     
  5. HighStakes5000

    HighStakes5000

    Joined:
    Nov 12, 2009
    Posts:
    10
    wt6y0896hu30t thank you im a tard
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Nah, it's a well-known fact that typos in your own code are 673% more difficult to spot than typos in someone else's code....

    --Eric