How to use partial classes in Unity

Nothing is going to work as long as it is named with a .txt extension.

Canonically, C# files should be .cs extension.

Did you make these files with Notepad perhaps?

You should right-click in Unity to make the script file, then doubleclick in Unity to open it.

Notepad should not have anything to do with your code editing process until you are SUPER-familiar with C#.

If visual studio is misbehaving for you, this may help you with intellisense and possibly other Visual Studio integration problems:

Sometimes the fix is as simple as doing Assets → Open C# Project from Unity. Other times it requires more.

Also, try update the VSCode package inside of Unity: Window → Package Manager → Search for Visual Studio Code Editor → Press the Update button

Also, this: No suggestions in Vscode - Unity Engine - Unity Discussions

1 Like