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!
Creating a javascript with the name Input would do the same thing, it makes a class called Input.
– whydoidoitYou made a class called Input, which doesn't have a GetAxis function, so when you say "Input.GetAxis", Unity looks in your Input class and doesn't find any GetAxis function, and complains. You can differentiate by saying "UnityEngine.Input", but as I said, it's better just to not do that.
– Eric5h5To be clear - you haven't made a script called Input in Javascript? It's got to be that or the fact you have created a variable called Input which is of type GameObject.
– whydoidoitYep, it's usually the smart thing to do :p
– Berenger