Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

How to get focus to my UI elements when using Oculus rift?

Discussion in 'VR' started by Dinesh_GDC, Jun 29, 2020.

  1. Dinesh_GDC


    Mar 10, 2019
    What I'm looking for right now is to show an Input field on a keyboard key click where the user can enter some name and later when the user hits enter, some operation happens.

    Next similarly, when I hit another key, a drop-down should appear, with a set of names taken from a file, and when I hit down arrow on keyboard, the focus should move to next item and then upon pressing enter, another event should be triggered based on that selected item name.

    I'm not clear on how to get focus to my UI elements when using Oculus. Normally I can directly use my mouse pointer, but I don't know how should I do it in Oculus.
    And I'm completely new to drop-down in unity.

    Can someone point me the right direction on how to proceed. I need advice on the following things.

    1. Get focus to InputField enter data. Later pressing Enter should trigger a function.

    2. Get focus to drop-down and be able to navigate through it using arrow keys. Upon pressing Enter, another event should be triggered with selected item name.

    As for adding both the UI, I plan to add them in editor and disable them. I will enable them on their respective key clicks. Will this approach work?

    Any help is greatly appreciated.!