Solution for Unity/SteamVR: Unable to reference any SteamVR namespace/types in scripts
is Given Below:
I have a Unity project (2020.3.12f1) set up with the SteamVR plugin (2.7.3) and OpenVR (1.1.4). All of the SteamVR folders that were imported from the Unity asset store are placed directly inside my Assets folder. I am getting namespace/type not found errors for anything from the SteamVR plugin despite including the “using Valve.VR;” statement.
Most of what I found online mentioned compile order problems, so I tried moving the SteamVR folders into the plugins folder, which is compiled before everything else in the Assets folder, but this did not work.
I also only get the errors when trying to do a build. If I make changes to the script in VS code and then return to the editor, unity recompiles the script and does not give any errors then, but will give the errors after I start the build.
I can also add the SteamVR components that I am getting errors about to game objects in the scene, so unity is aware of those classes.