Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Using the mouse (Vive)

Discussion in 'AR/VR (XR) Discussion' started by iddqd, Oct 6, 2016.

  1. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    500
    For testing purposes i would like to drag items with the mouse and not just with the controllers.

    Normally i could use
    Code (CSharp):
    1. Camera.main.ScreenPointToRay(Input.mousePosition);
    However this returns an offset position when using SteamVR.

    Does anybody have a solution for this?
    The VR Camera Frustum does not adapt to the game view size so i'm assuming that's the issue...

    thanks.
     
  2. hellaeon

    hellaeon

    Joined:
    Jul 20, 2010
    Posts:
    90
    I am curious as to whether you managed to solve this? I am using the vive screen as per normal, but on the main display using a separate camera target with a separate UI layer for the non VR screen view. On that screen I want to be able to interact with UI stuff...
     
  3. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    My tutorial shows how to fix this for gear vr (I dont have a vive) but I think it's the same problem because virtual reality supported is enabled:
     
  4. hellaeon

    hellaeon

    Joined:
    Jul 20, 2010
    Posts:
    90
    Thanks for the reply. I am using Newton VR, which has its own event system. I will need to check that first and if I can figure it out (Maybe I just dont use newton VR?) I will reply how I managed to do it.
     
  5. OT2O

    OT2O

    Joined:
    Feb 3, 2016
    Posts:
    5
    Did you ever solve this? I am trying to do the exact same thing
     
  6. OT2O

    OT2O

    Joined:
    Feb 3, 2016
    Posts:
    5
    Does anyone know how to fix this?
     
  7. PeteSmalls

    PeteSmalls

    Joined:
    Apr 29, 2020
    Posts:
    11