Oh yeah I didn’t see the float in the beginning of your error, my bad!
Anyways, I found a step by step guide that could help:
If Visual Studio Code is not recognizing the Input class or the GetAxis method, and you’ve already ensured that your script includes the necessary using UnityEngine; statement, there might be an issue with the Unity Tools for Visual Studio Code.
Here are some additional steps you can take:
Restart Visual Studio Code:
Close Visual Studio Code and reopen it. This ensures that any changes or extensions you’ve installed take effect.
Unity Debugger Extension:
Open Unity Preferences in Visual Studio Code (Cmd + ,), and ensure that the “Unity Debugger” is selected.
Reinstall C# Extension:
Try uninstalling and reinstalling the C# extension for Visual Studio Code. You can do this from the Extensions view (Ctrl+Shift+X).
Check Unity Project Settings:
Verify that your Unity project settings are configured properly. Go to Edit > Project Settings > Player and ensure that the “Api Compatibility Level” is set to “.NET Standard 2.0” or “.NET 4.x Equivalent.”
Update Unity and VSCode:
Ensure that you are using compatible versions of Unity and Visual Studio Code. Sometimes, updating Unity and Visual Studio Code to the latest versions can resolve compatibility issues.
Check for Errors in VSCode Output:
Look for error messages or warnings in the Output tab in Visual Studio Code. This may provide more information about why the autocomplete is not working.
In Unity, the necessary libraries, including UnityEngine, are typically part of the Unity Editor installation, and you don’t need to separately install them on your device. However, you can perform a few checks to ensure that everything is set up correctly:
Unity Installation:
Ensure that you have Unity Hub installed, and you’ve installed a version of Unity that includes the modules you need. Unity should automatically include the necessary libraries like UnityEngine.
Project Folder Structure:
Make sure that your Unity project has a proper folder structure. Unity scripts should be placed within the Assets folder. If your script is not recognized, it might be in the wrong location.
Library Folder:
Unity generates a Library folder within your project. This folder contains various cached data and assemblies. Ensure that this folder is present in your Unity project directory.
Reimport All Assets:
In the Unity Editor, try selecting Assets > Reimport All to force Unity to refresh and reimport assets. This can help ensure that any missing or corrupted files are updated.
Check .csproj File:
Open the .csproj file associated with your Unity project and verify that it includes the necessary references, including .
Unity Preferences in VSCode:
Ensure that you have the correct Unity version selected in the Unity Preferences in Visual Studio Code (Cmd + ,). Also, make sure the “Unity Debugger” is selected.
Clean and Rebuild:
In Unity, try selecting Assets > Open C# Project to open the C# project files in Visual Studio Code. Then, try rebuilding the project using the Visual Studio Code command palette (Ctrl + Shift + P > “Clean Solution” and “Rebuild Solution”).
This is what I managed to find, hope this helps!