ValveSoftware/steamvr_unity_plugin

Unable to reference Valve.VR Namespace outside of SteamVR folder

The-Beekeeper opened this issue · 13 comments

Hello, it seems that for whatever reason I am unable to reference the Valve.VR class when the script lies outside of the SteamVR folder within Visual Studio 2017. But only within unity 2019.3.12f1, when I import my project into unity 2018.4.22f1 it works perfectly fine and I can reference the class whenever and wherever. I've been at a loss for a solution, and I would greatly appreciate any and all assistance. And as far as I can see it should work within Unity 2019.3, please correct me if I am wrong.

I am using SteamVR plugin version 2.5.0

Update: I updated to unity 2020.1.0b7 beta and installed the OpenVR plugin made for unity's new XR plugin system along with the SteamVR 2.6 beta. And now all my problems have disappeared, still have no idea why I had this problem in the first place.

Using unity 2019.3 within the SteamVR/InteractionSystem/Sample folder.
image

Using unity 2019.3 in a scripts folder outside of the SteamVR folder.
image

Using unity 2018.4 in a scripts folder outside the SteamVR folder.
image

zite commented

Yeah, strangely this is a Unity 2019.3.12 bug. It works fine in 2019.3.11. I'd recommend downgrading or waiting for a fix as 2020+ is still in beta/alpha. https://unity3d.com/get-unity/download/archive

Hello everyone,

First of all, I'm sorry to reply on this issue and not create a new one.

It's just that I happen to have the same problem even though I'm using the 2021.3.1f1 Unity version. I get this error when I try to Build and Run for Android.

Does anyone know how to solve or troubleshoot this problem ?

Thanks in advance.

Have a good day !

Hi @Hamza-Falih,
did you solved your problem in Building? How did you maneged to solve it?

Thanks in advance,
Have a good day!

@Hamza-Falih @mariannapizzo97 did you manage to fix / work around this problem? Or only through changing the Unity version? I seem to have similar problems as @Hamza-Falih (also seeing these errors when trying to build for Android), using 2019.2.21f1 (stuck with that version for the moment, since the project I'm working on has been initially written in that version, and I'm not familiar enough with all the changes since to migrate to a later Unity version).

Hello @mariannapizzo97 and @codeling,

Unfortunately, I wasn't able to solve this problem after all because, as @codeling mentionned, I was also stuck with that Unity version since the project I was working on was originally written in that version. Since last time, someone took over the project in my place and they were able to find a turnaround to fix the problem apparently. Maybe they updated to a newer Unity version and installed newer versions of OpenVR plugin and SteamVR as the original poster said.

I hope you will be able to solve your problem.

I will try to be available in case you need further help.

Good luck and have a nice day !

PS : Sorry @mariannapizzo97 for this late reply.

This bug has occurred for me on Unity 2021.3.4f LTS

This is a bug for Unity 2022.3.7f1

For multiple versions of Unity including 2019, 2020,2021,2022,2023 you can't build except if you use PC and build an .exe
This works fine with SteamVR but not for Android apk distribution. I am going to have to get rid of SteamVR and use Unity VR toolkit instead. I guess that was the plane by Unity?! :(

Hello @rodaraknia,

we opened an issue and they fairly told us that you can't build an apk using SteamVR. So yes, you have to do it unfortunately.

Thank you for this feedback @rodaraknia and @mariannapizzo !

I'm having the same issue using Unity 2022.3.12f1 and couldn't get it sorted out so far.

//e: Ok, nevermind. I got it fixed by revisiting the assembly definition of my project and adding "SteamVR" instead of "Valve.VR". I made a wrong assumption there.

I'm having the same issue using Unity 2022.3.12f1 and couldn't get it sorted out so far.

//e: Ok, nevermind. I got it fixed by revisiting the assembly definition of my project and adding "SteamVR" instead of "Valve.VR". I made a wrong assumption there.

please can you tell how to fix this issue i am using Valve.VR but its not importing

Just wasted an hour on this before I remembered I had an actual interactable valve object in the game and a Valve.cs that just needed to be renamed haha.