Forum Discussion
khos85
11 years agoExplorer
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?
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?
4 Replies
Replies have been turned off for this discussion
- cyberealityGrand ChampionCan you try using PhysicsRaycaster?
http://docs.unity3d.com/460/Documentation/ScriptReference/EventSystems.PhysicsRaycaster.html - weasel47Heroic ExplorerSee here for a discussion of the same topic:
viewtopic.php?f=37&t=17827 - khos85Explorer
"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. - lchawkinsHonored Guesti´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");
}
}
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 4 months ago
- 2 years ago