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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

OnMouseOver but for VR pointer, please help to start

Discussion in 'Scripting' started by mauricito4, Oct 30, 2019.

  1. mauricito4

    mauricito4

    Joined:
    May 12, 2013
    Posts:
    120
    Hello,
    I'm starting at OCULUS_GO, and I need to call a scene with the control of a button in space, and, for the moment, it works with mouseOVER.
    How can I convert this code to make it work by pointing to the oculus go control?
    how should the script go
    Thank you very much for any help.

    Code (CSharp):
    1.  
    2. public class button_call_scene : MonoBehaviour
    3. {
    4.       public void OnMouseOver()
    5.      {
    6. Application.LoadLevel("main_scene");
    7.      }
    8.  
    9. }
    .
    upload_2019-10-30_7-11-34.png
     
  2. csofranz

    csofranz

    Joined:
    Apr 29, 2017
    Posts:
    1,556
    I recommend that for absolute basic stuff like this you check out Unity's VR tutorials. They explain how you can do this (not only with a Controller, but also with gaze - simply looking at things), and also provide some nice scripts. I believe there are even some nice free Unity-provided Projects in the asset store.
     
  3. mauricito4

    mauricito4

    Joined:
    May 12, 2013
    Posts:
    120