`Input' does not contain a definition for `GetAxis'

Hello everyone!

I have been a unity3D user for several years now, and I have developed a decent ability with C# scripting inside the engine.

Just recently, I have encountered this error while scripting:

‘Input’ does not contain a definition for ‘GetAxis’

The same goes for any other input definitions.

I have no clue what is wrong. When using MonoDevelop, the only definitions available in Input are those that belong to Object/GameObject.

I am sure that this isn’t a problem with any script I have, as it is currently just a copy of an example from the scripting reference, additionally, the script was working fine for several test beforehand.

Any tips would be greatly appreciated!

Don’t name your classes the same thing as Unity classes. (Well, you can, but if you do that then you have to specify which one you mean every time, which is a bit annoying.)

For anybody else, who maybe more recently than 2 years ago encountered this problem. I just fixed mine with: changing float moveHorizontal = Input.getAxis(“Horizontal”); to

{
float moveHorizontal = UnityEngine.Input.GetAxis(“Horizontal”);
}

It doens’t recognize the getAxis without a CAPital G and it doesn’t recognize the Input without UnityEngine attached.