Author Topic: Input Axis is not setup  (Read 7253 times)

gangrel

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Input Axis is not setup
« on: April 19, 2012, 02:05:52 PM »
I've just upgraded from 1.4.8 to 2.0.3, and am getting a UnityException: Input Axis is not setup when mousing over objects in my game.  The specific complaint is coming from UICamera.cs:604, which calls Input.GetAxis(scrollAxisName).

In can see in Project Settings -> Input that there is indeed a Mouse ScrollWheel entry, so have no idea why this exception is being thrown.

I saw a thread on the old forums, about unchecking Use Controller on my UICamera.  I tried it, but it didn't make any difference.

It's benign, and I've wrapped the call in a try-catch.  Even so, I'm curious to find out what's causing this, and how to stop it without having to patch UICamera.

Thanks...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Input Axis is not setup
« Reply #1 on: April 19, 2012, 03:42:26 PM »
Select your UICamera in the inspector. There is a field where you choose what axis is used for the scroll wheel. Ensure it's what you think it is.

gangrel

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Input Axis is not setup
« Reply #2 on: April 19, 2012, 04:16:53 PM »
Makes sense, although I find I need to keep the try-catch in place.  For iPhone development, I don't always want to build and run on the device, so I'll Play within Unity on the Mac.  UICamera.Awake() will correctly set all but useTouch to false on the iPhone, while on the Mac, everything remains true.  It's on the Mac that the Mouse ScrollWheel isn't being found.

So the question is, any idea why Input.GetAxis can't find it, even though I can see it in Project Settings -> Input?