Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

UnassignedReferenceException when add handle texture with OpenVR

Discussion in 'VR' started by dienat, Oct 17, 2019.

  1. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    417
    I use this code trying to make appear a texture in openvr using Unity but i get the UnassignedReferenceException when try to add the handle texture inside OnGUI, but the texture is well asigned and has a value

    var overlay = OpenVR.Overlay;
    if (overlay != null)
    {
    var texture = new Texture_t();
    texture.handle = handletexture.GetNativeTexturePtr();
    texture.eType = SteamVR.instance.textureType;
    texture.eColorSpace = EColorSpace.Auto;
    overlay.SetOverlayTexture(progressBarOverlayHandle, ref texture);
    }
     
  2. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    417
    I got to solve the UnassignedReferenceException but SetOverlayTexture doesnt draw any image on screen