Search Unity

mouse pick and mouse cursor don't align in editor play mode when VR enabled

Discussion in 'AR/VR (XR) Discussion' started by westingtyler, Oct 19, 2016.

  1. westingtyler

    westingtyler

    Joined:
    Dec 7, 2013
    Posts:
    34
    I use a mouse pick to determine where the laser sight should land in my game. Since updating to unity 5.4.0b24, the cursor in the play mode window does not line up with the mouse picked location. This offset bug only happens when Virtual-Reality Enabled (Oculus) in Player Settings. playmaker 1.8.2f7 windows 10 64 bit.

    Specifically, the location v3 saved by the mouse pick (shown in white text in the game window) DOES correspond to the location of the objects in the scene, but to make my laser pointer be at that spot, I have to move my actual cursor up and to the right, so far sometimes that I try to shoot a flying enemy, and it defocuses play mode because I have clicked outside the window. this used to work fine, and now I can't playtest my game very well. The mouse pick works normally in a compiled game (because it takes up the whole screen?) but obviously it's not viable to compile a build of my game every time I want to playtest.

    I uploaded a video of the problem. It may have to do with the new unity game view scale slider messing up the location while VR is enabled. https://youtu.be/wEiAFg9KpM8


     

    Attached Files:

  2. glardon

    glardon

    Joined:
    Apr 8, 2015
    Posts:
    14
    Hi,
    same problem here. Any solution ?
     
  3. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Here ya go:
     
  4. westingtyler

    westingtyler

    Joined:
    Dec 7, 2013
    Posts:
    34
    Thanks. This solution seems to be aimed at the build of a Gear VR. I need this to work in the editor play mode for oculus rift. is it likely to work?
     
  5. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Possibly, as the error here is dealing with Native Unity VR integrations, not Gear VR specifically. For example, the same fix works for native Daydream builds.