Is "Input.GetAxis" depreciated now in 2021 LTS?

I’m not entirely sure if this is no longer supported in Unity, or if my script editor just isn’t exposing it anymore for intelligent autocomplete. The instructor may want to update the course to only use the “new way”, since it appears Unity is heavily discouraging use of the “old way” in new versions.

Update: It still does work, but my script editor tries to autocomplete to “iPhoneInput” instead of “Input.” every time.

It is frustrating needing to cancel out of the autocomplete each time while typing and then finish manually.

edit: Oddly, saving the script out with the Input.GetAxis() call and then re-opening it has added the option to the autocomplete menu!

Hi glumvar,

Yes, Input.GetAxis still works in Unity 2021. What you describe in your second answer in this thread sounds as if there might be a problem with your script editor. If restarting helped, consider it fixed.

If the issue persists, please follow the instruction on this website and make sure all required extensions are installed: https://code.visualstudio.com/docs/other/unity

If the issue persists, please check the console of VS Code (not Unity!). If the .NET Framework 4.7.1 (Developer Pack) is mentioned there, download and install it from the official Microsoft. Here is the link: https://dotnet.microsoft.com/download/dotnet-framework/net471

Depending on your version of Unity, it might be that you will have to install the “Visual Studio Code Editor” package in Window > Package Manager in Unity.

  1. Press Ctrl + Shift + P in VS Code.
  2. Type “OmniSharp: Select Project” and press Return.
  3. Select the solution workspace entry.

Maybe you’ll have to reboot your computer. Then launch Unity again and open one of your scripts.


See also:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms