Class not accepted?

The above line of code is totally valid, but you can’t just write that alone. It must be inside an appropriate MonoBehaviour-derived class.

If you don’t know how to do that, scroll down for some good coding tutorials to get you started.

If you are just getting errors from Visual Studio, 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

These are some good initial coding tutorials:

Imphenzia / imphenzia - super-basic Unity tutorial:

Jason Weimann:

Brackeys super-basic Unity Tutorial series:

Sebastian Lague Intro to Game Development with Unity and C#: