[solved]steamvr update 1.2.0 has 2 compiler error

Does anyone have the same problem after update steamver to 1.2.0?
These are two compiler errors I met
"Assets/SteamVR/Scripts/SteamVR_Status.cs(31,31):error CS0117: ‘SteamVR_Utils’ does not contain a definition for ‘Event’
"Assets/SteamVR/Scripts/SteamVR_Status.cs(36,31):error CS0117: ‘SteamVR_Utils’ does not contain a definition for ‘Event’

2 Likes

After I reinstall SteamVR plugin, all problems were gone.

Hi, I received the same, but I was using SteamVR_Utils.Events in my code and it looks like Events has now gone and been replaced by a class “SteamVR_Events” which now has the event names as specific events.

So any references in your code to:
SteamVR_Utils.Event.Listen(“device_connected”, OnDeviceConnected)
SteamVR_Utils.Event.Remove(“device_connected”, OnDeviceConnected);
now need to change to:
SteamVR_Events.DeviceConnected.Listen(OnDeviceConnected);
SteamVR_Events.DeviceConnected.Remove(OnDeviceConnected);

where OnDeviceConnected now takes (int deviceId, bool isConnected).

4 Likes

The C-script involved is SteamVT_Status.cs … tow functions OnEnable and OnDisable contain both a reference tot Event
Event.Listen and Event.Remove. This reference is not in place in the plugin scripts …

The question is ‘how to solve this’ !?

Ok… I just marked the two lines as comment … Seems to be working.
Since the plugin upgrade I get a lot of other ‘temporary’ errors…
I don’t think this upgrade is really well tested !!!

I had same error. Just delete old folder and reimport SteamVR.
I have also problem that [CameraRig] prefab won’t detect controllers.

Edit:
There was note in readme. Just needed to add SteamVr_UpdatePoses component to Camera (eye) gameobject.

but how to change this code:

SteamVR_Utils.Event.Listen("TrackedDeviceRoleChanged", RefreshControllerIndex);

I can’t find same word.~

Hi

Use:

SteamVR_Events.System(“TrackedDeviceRoleChanged”).Listen(OnTrackedDeviceRoleChanged);

And change the OnTrackedDeviceRoleChanged parameters like:

private void OnTrackedDeviceRoleChanged(VREvent_t args)

The problem comes from Unity which doesn’t erase any files during an update.
Just delete SteamVR plugin before doing an update. It will erase the files which were erased from v1.2 release.

Agreed - I was having those same errors, and tried reimporting the SteamVR plugin, but was still getting the errors. It wasn’t until I deleted the SteamVR folder completely and re-imported the SteamVR package - AND - restarted Unity - that the error went away.

I ran into

I had the same problem coming out of VRTK

And this got it compiling, but my project still locks up on play :frowning:

Someone can tell me how to solve this error and in what part I must put it, I am new to this and I do not know very well how it is solved

static OverlayKeyboardSample()
{
SteamVR_Events.SystemAction("KeyboardCharInput", OnKeyboardCharInput).Enable(true);
SteamVR_Events.SystemAction("KeyboardClosed", OnKeyboardClosed).Enable(true);
}

What error is being thrown? You’re showing code, but no error message (?)

Did you upgrade to a new version over an older version? - or - Did you delete the old install and then import the new package?

I’ve found that I tend to get errors if I just install the new package over the old one, so now I delete the old SteamVR folder completely before importing the new version (package). So far, this seems to work pretty reliably.

Activos / HTC.UnityPlugin / ViveInputUtility / scripts / misc / OverlayKeyboardSample.cs (22,24): CS1502 de error: El partido mejor método sobrecargado para `SteamVR_Events.SystemAction (Valve.VR.EVREventType, UnityEngine.Events.UnityAction <Valve.VR .VREvent_t>) 'tiene algunos argumentos no válidos

Activos / HTC.UnityPlugin / ViveInputUtility / scripts / misc / OverlayKeyboardSample.cs (22,24): error CS1503: Argumento # 1 'no puede convertir cadena’ expresión para escribir `Valve.VR.EVREventType ’

Activos / HTC.UnityPlugin / ViveInputUtility / scripts / misc / OverlayKeyboardSample.cs (23,24): CS1502 de error: El partido mejor método sobrecargado para `SteamVR_Events.SystemAction (Valve.VR.EVREventType, UnityEngine.Events.UnityAction <Valve.VR .VREvent_t>) 'tiene algunos argumentos no válidos

Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/OverlayKeyboardSample.cs(23,24): error CS1503: Argument #1' cannot convert string’ expression to type `Valve.VR.EVREventType’

i’am usin the Aseet ViveInputUtility

Ah - so - you’re getting an error from an Asset Store Package … well, you should probably contact the author to see if they can help you (if some basic troubleshooting doesn’t do the trick). Their page (Vive Input Utility) says that it’s compatible with SteamVR V1.2.0, and the latest version of SteamVR is 1.2.1 - so there might be a conflict that was introduced in the upgrade from 2.0 to 2.1.

You might also delete your SteamVR folder and any “openvr_api” files in your Plugins folder, and then re-import the SteamVR Plugin. If you still get an error, try re-importing your Vive Input Utility after re-installing Steam.

Joe

Ready friend, thank you very much, I think it is the plugin version.

Upgrading from Unity v5.4.3 to v5.5.2 and updating the SteamVR required removing the SteamVR_Status.cs , SteamVR_Status.meta, and SteamVT_StatusText.cs, SteamVT_StatusText.meta fixed the Assets/SteamVR/Scripts/SteamVR_Status.cs(31,31):error CS0117: ‘SteamVR_Utils’ does not contain a definition for ‘Event’. However nothing in the project was using these scripts. When creating a new project the four classes do not seem to be created. I highly suggest backing up the 4 files in a completely different file structure. The files are located in Assets/SteamVR/Scripts. Also the project required replacing the following files with a newer versions to prevent warnings from showing in the console window. Again copy the files just in case. ColorCorrectionLookupEditor.cs located at Assets/Editor/ImageEffects and MotionBlur.cs and PostEffectsBase.cs located at Assets/StandardAssets/Effects/ImageEffects. Hope this helps someone else.

Delete older SteamVR folder then install SteamVR plugin from asset store
Problem fixed

2 Likes