Forum Discussion
Anticleric
11 years agoMember
OVRMainMenu and GUI problem in Unity 4.6
Hey guys. Need a little help here.
Under Unity 4.6 with SDK 0.4.4 when I load the main menu gui (hit spacebar by default) I get this yellow warning:
Then if I load another scene, the menu no longer works. Which means I can't even hit escape to exit the game.
I get this red error in the editor repeating constantly:
Looks like once I load it, it always checks in the same place when I load a new scene.. but it's been destroyed.
Sounds like it should be an easy fix.
Any pointers?
Thanks!
Under Unity 4.6 with SDK 0.4.4 when I load the main menu gui (hit spacebar by default) I get this yellow warning:
Parent of RectTransform is being set with parent property. Consider using the SetParent method instead, with the worldPositionStays argument set to false. This will retain local orientation and scale rather than world orientation and scale, which can prevent common UI scaling issues.
UnityEngine.Transform:set_parent(Transform)
OVRUGUI:UIObjectManager(GameObject, String, Single, String, Int32) (at Assets/OVR/Scripts/Util/OVRUGUI.cs:248)
OVRUGUI:InitUIComponents() (at Assets/OVR/Scripts/Util/OVRUGUI.cs:235)
OVRUGUI:UpdateGUI() (at Assets/OVR/Scripts/Util/OVRUGUI.cs:120)
OVRMainMenu:Update() (at Assets/OVR/Scripts/Util/OVRMainMenu.cs:412)
Then if I load another scene, the menu no longer works. Which means I can't even hit escape to exit the game.
I get this red error in the editor repeating constantly:
MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
OVRUGUI.UpdateVariable () (at Assets/OVR/Scripts/Util/OVRUGUI.cs:132)
OVRUGUI.UpdateGUI () (at Assets/OVR/Scripts/Util/OVRUGUI.cs:123)
OVRMainMenu.Update () (at Assets/OVR/Scripts/Util/OVRMainMenu.cs:412)
Looks like once I load it, it always checks in the same place when I load a new scene.. but it's been destroyed.
Sounds like it should be an easy fix.
Any pointers?
Thanks!
5 Replies
Replies have been turned off for this discussion
- AnonymousI am experiencing the same problem. The menu only works in the first scene, every new scene (not additive) breaks the menu.
Unity 4.6.1p4, SDK 4.4 - Anonymous
- AnticlericMember
"ronczarnik" wrote:
See here for possible fix:
viewtopic.php?f=37&t=18124
Nope. No go. :(
Same errors.
I'll just go back to Unity 4.5 I guess. Not seeing FPS makes optimizing hard. - AndyCoplanarExplorerThis should fix it...
Add this method to OVRUGUI:
public static void ResetGUI()
{
isInited = false;
}
Then add the following line at the beginning of the Awake method of OVRMainMenu.
OVRUGUI.ResetGUI();
Note this will only work if OVRMainMenu is on an object which you haven't mark as DontDestoryOnLoad. - AnticlericMemberAmazing! Totally fixed it. Thanks Andy. You da man :)
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
- 9 months ago
- 1 year ago
- 8 months ago