Skip to main content
Up and Coming
December 23, 2014

I cannot get 4.6 GUI menu to work with OVR - help?

Hi,

I'm trying to use the new GUI system in Unity 4.6, I have a canvas set to worldspace, and a button which uses an event trigger to load a new scene, this points to functions in code:

function letgo(){Application.LoadLevel("snow1");}
function letquit(){Application.Quit();}

In my test scene with no Oculus Rift OVR Cameras it works fine, but if I take these objects to my proper game scene that has Oculus Rift components the buttons do not work, I can see then when the game runs but they do not seem to detect the mouse over or click at all. Why?

How can I get this working?
I thought that this would solve the Unity GUI problems.. but not sure what to do next exactly..
Does anyone have sample code or sample Unity export of how this works, how to make the menus work in Unity with Oculus Rift?
    This topic has been closed for replies.

    4 replies

    Inspiring
    December 23, 2014
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Inspiring
    December 23, 2014
    See here for a discussion of the same topic:
    viewtopic.php?f=37&t=17827
    khos85Author
    Up and Coming
    December 23, 2014
    "cybereality" wrote:
    Can you try using PhysicsRaycaster?

    http://docs.unity3d.com/460/Documentation/ScriptReference/EventSystems.PhysicsRaycaster.html


    Many thanks Cyberreality, I will look at using raycasting.
    New Participant
    January 26, 2016
    i´ve solved this problem with physics ray caster, but i can't found any solution with the second button at the same scene.
    if you only need one button, try this:
    1.- add canvas to the scene and drop into the script Graphic Raycaster (if you have any problem i can send you)
    2.-at eventsystem, disable standalone input module and drop into the script gaze input module, select mode "gaze" and the script gaze input module crosshair.
    3.-add a game object, create empty to the scene, and add the script "button next level"
    4.- add one button to the canvas, and add the game object to the onclick area anti select the function "nextlevelbutton string"

    when i do this, i have a world position button that load the scene. i have problem when i need two buttons, because when i repeat all the operation fr the second button, this one doesnt work. the first one work perfectly.
    Anyone knows any solution?

    the script that load the scene is this:

    using UnityEngine;
    using System.Collections;

    public class ButtonNextLevel : MonoBehaviour
    {
    public void NextLevelButton(int index)
    {
    Application.LoadLevel(index);
    }

    public void NextLevelButton(string level2)
    {
    Application.LoadLevel("level2");
    }
    }