Search Unity

[solved]steamvr update 1.2.0 has 2 compiler error

Discussion in 'AR/VR (XR) Discussion' started by agassi415, Jan 13, 2017.

  1. agassi415

    agassi415

    Joined:
    Jan 13, 2017
    Posts:
    3
    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'
     
    CloudyVR and SantiagoIsAFK like this.
  2. agassi415

    agassi415

    Joined:
    Jan 13, 2017
    Posts:
    3
    After I reinstall SteamVR plugin, all problems were gone.
     
  3. LondonStevey

    LondonStevey

    Joined:
    Jun 26, 2015
    Posts:
    33
    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. Avatarum

    Avatarum

    Joined:
    Jan 10, 2017
    Posts:
    4
    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 ....
     
  5. Avatarum

    Avatarum

    Joined:
    Jan 10, 2017
    Posts:
    4
    The question is 'how to solve this' !?
     
  6. Avatarum

    Avatarum

    Joined:
    Jan 10, 2017
    Posts:
    4
    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 !!!
     
  7. Limba

    Limba

    Joined:
    Mar 4, 2014
    Posts:
    10
    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.
     
    Last edited: Jan 13, 2017
  8. John-Lee-CN

    John-Lee-CN

    Joined:
    May 9, 2013
    Posts:
    2
    but how to change this code:
    Code (CSharp):
    1. SteamVR_Utils.Event.Listen("TrackedDeviceRoleChanged", RefreshControllerIndex);
    I can't find same word.~
     
  9. futer24

    futer24

    Joined:
    Oct 27, 2013
    Posts:
    13
    Hi

    Use:

    SteamVR_Events.System("TrackedDeviceRoleChanged").Listen(OnTrackedDeviceRoleChanged);

    And change the OnTrackedDeviceRoleChanged parameters like:

    private void OnTrackedDeviceRoleChanged(VREvent_t args)
     
  10. knguyen-mimbus

    knguyen-mimbus

    Joined:
    Apr 12, 2016
    Posts:
    2
    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.
     
  11. jwilliamsen

    jwilliamsen

    Joined:
    Aug 8, 2010
    Posts:
    56
    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.
     
  12. MrPhil

    MrPhil

    Joined:
    Sep 22, 2010
    Posts:
    40
    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 :(
     
  13. Martinez-Vargas

    Martinez-Vargas

    Joined:
    Jun 24, 2016
    Posts:
    39
    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

    Code (CSharp):
    1. static OverlayKeyboardSample()
    2. {
    3. SteamVR_Events.SystemAction("KeyboardCharInput", OnKeyboardCharInput).Enable(true);
    4. SteamVR_Events.SystemAction("KeyboardClosed", OnKeyboardClosed).Enable(true);
    5. }
     
  14. jwilliamsen

    jwilliamsen

    Joined:
    Aug 8, 2010
    Posts:
    56
    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.
     
  15. Martinez-Vargas

    Martinez-Vargas

    Joined:
    Jun 24, 2016
    Posts:
    39
    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'
     
  16. Martinez-Vargas

    Martinez-Vargas

    Joined:
    Jun 24, 2016
    Posts:
    39
    i'am usin the Aseet ViveInputUtility
     
  17. jwilliamsen

    jwilliamsen

    Joined:
    Aug 8, 2010
    Posts:
    56
    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
     
  18. Martinez-Vargas

    Martinez-Vargas

    Joined:
    Jun 24, 2016
    Posts:
    39
    Ready friend, thank you very much, I think it is the plugin version.
     
  19. devsh42

    devsh42

    Joined:
    Mar 16, 2017
    Posts:
    2
    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.
     
  20. Omkar07

    Omkar07

    Joined:
    May 16, 2018
    Posts:
    1
    Delete older SteamVR folder then install SteamVR plugin from asset store
    *Problem fixed*
     
    WQ-Charles and frstrtr like this.