Can't use target, GetComponent, transform, or other shortcuts.


My script is assigned to an empty GameObject. Why can’t I use the usual Unity functions like target or transform? This is in a completely fresh project on the latest version. All of my usings seem to be in order. What could I be missing?

My solution was to force Unity to generate a .csproj file with every script I create in the editor. I found this setting in Unity under Edit > Preferences > External Tools, where I set my External Script Editor to Visual Studio explicity (instead of “Open by file extension”) and checking “Generate all .csproj files.”