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

Oculus Rift DK 2 and Canvas UI buttons won't click/function.

Discussion in 'AR/VR (XR) Discussion' started by steb92, Mar 20, 2015.

  1. steb92

    steb92

    Joined:
    Nov 7, 2014
    Posts:
    29
    Hi all,

    I have a simple canvas UI I've created for my game and it has a button to return to the menu when dead. The canvas is attached to the OVRCameraRig. However, when I try to physically click on the button using my mouse, it won't work.

    However, if I mount the canvas UI to the standard Unity Main Camera, it works fine.

    Any suggestions?
     
  2. hazeyy

    hazeyy

    Joined:
    Feb 24, 2015
    Posts:
    4
    Don't use a mouse. Have a script attached to your event system that picks up where your camera is looking, then have a button click to select button. I have a BasicLookInputModule script attached to my event system, that lets the canvas pick up where my camera is looking and I use spacebar to select the buttons.
     
  3. El Maxo

    El Maxo

    Joined:
    May 23, 2013
    Posts:
    177
    correct me if I am wrong, but don't you have to assine what camera to use on the canvas?
     
  4. steb92

    steb92

    Joined:
    Nov 7, 2014
    Posts:
    29
    The canvas is assigned to my camera, yes.

    The problem seems to be that when the player dies in-game, the scene loads the Game Over.unity scene. When this new scene loads, there is no mouse cursor to click any buttons. However, the Main Menu (which is scene 0), has a functioning mouse cursor. I don't understand the difference!