steamvr_unity_plugin icon indicating copy to clipboard operation
steamvr_unity_plugin copied to clipboard

using Valve.VR isn't importing namespace

Open FFSchier opened this issue 7 years ago • 5 comments

After importing the SteamVR-Plugin (assetstore or github), my Visual Studio is not able to work with the "using Valve.VR;". It doesn't throw an error, but it is not auto-completing SteamVR specific variables when I type.

image

Tried so far: on multiple projects, multiple versions of SteamVR (2.0.1 from AssetStore and newest Beta) opened the downloaded Beta version from the downloadlocation as a project directly.

Edit: OpenVR is installed

FFSchier avatar Jan 22 '19 19:01 FFSchier

Might try RC2 on the releases page, it has fixed a couple assembly definition things since the betas. If that doesn't work try and delete the .sln and .csproj files in the root of your unity project. Unity should rebuild them correctly.

keithbradner avatar Jan 22 '19 20:01 keithbradner

Yeah, based on the long changelog, I used RC2 before. Just tested it with different versions of unity (2018.3.2f1, 2018.3.0f2, 2018.2.20f1) with RC2 - no fix. I inserted the Assets into assets and replaced project settings with those from the downloaded folder.

Unity rebuilt all the deleted files, but Visual Studio still doesn't understand anything from Valve.VR's namespace.

FFSchier avatar Jan 22 '19 22:01 FFSchier

Welp. Problem found: wrong Unity settings, that presumably came with a reinstall after bigger unity update. Just in case somebody stumbles as well: image ... was set to wrong editor.

Thanks so much!

FFSchier avatar Jan 23 '19 01:01 FFSchier

Welp. Problem found: wrong Unity settings, that presumably came with a reinstall after bigger unity update. Just in case somebody stumbles as well: image ... was set to wrong editor.

Thanks so much!

Thank you very much, you helped me a lot! ;)

mlekoo avatar Feb 22 '20 10:02 mlekoo

This is happening to me with the proper IDE set using Unity 2019.3 with Open VR Desktop 2.0.5 and Steam VR2.2.0. I have regenerated project files for the .csproj from all sources. I have deleted .csproj and .sln as well as .vs files and allowed Unity to regenerate them. Saved closed rebooted etc but the Valve namespace and all sub namespaces fail giving me a repeating error:

" NullReferenceException: Object reference not set to an instance of an object Valve.VR.InteractionSystem.Sample.LockToPoint.FixedUpdate () (at Assets/SteamVR/InteractionSystem/Samples/BuggyBuddy/LockToPoint.cs:54) "

The LockToPoint script is being called in another script which gives an error "The type or namespace 'LockToPoint' could not be found..." while the using Valve.VR.InteractionSystem.Sample; says "Using Directive is Unnecessary". Removing .Sample from the using removes the last error but the namespace remains grayed out and the reference to LockToPoint still throws errors?

Things like // (SteamVR) Player reference public Valve.VR.InteractionSystem.Player player; public Valve.VR.InteractionSystem.Hand leftHand; public Valve.VR.InteractionSystem.Hand rightHand;

Which have worked for months all fail now do to a missing assembly reference with using Valve.VR; present.

Any idea whats going on or how to fix it?

Giantbean avatar Jul 08 '20 14:07 Giantbean