Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Ereptor · Dec 02, 2015 at 06:33 PM · uicanvasoculus

Help! Canvas element cannot be seen in Oculus. (Unity 5.2.3) (C#)

Hello everyone,

I dearly miss my GUI.Button()s right now, because I'm having to learn UI all over again for my new project. And UI was about the only thing I fully understood!

I have a scene which I have set up using Oculus Rift and its default OVRPlayerController which contains the scene's MainCamera, with a culling mask set to Everything and depth set to 0.

I also have a new Canvas in the scene which is active and uses Screen Space - Overlay and Pixel Perfect. Inside of this canvas is a single element, a Text I am calling DoorOpenPrompt which simply says "Press A to Open Door". I have a Canvas Group assigned to this which I will be altering in a script, changing the alpha based on whether I have come into contact with a door Trigger.

However, even with the Alpha defaulted to 1 and Interactable and Blocks Raycasts defaulted to true on my DoorOpenPrompt's Canvas Group, the Text does not display in my game screen nor in my Oculus' rendering of the game screen.

All of my UI/Canvas elements are on the UI layer, which is being rendered (along with Everything) by my Main Camera, which is part of the OVRPlayerController's OVRCameraRig.

What am I missing? Why is nothing displaying at all?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ereptor · Dec 02, 2015 at 07:29 PM 0
Share

Adding a default Button at the center of the canvas also does not display in Game mode, neither on screen nor in the Oculus.

avatar image Ereptor · Dec 02, 2015 at 07:29 PM 0
Share

Here is an image of a scene I made from scratch in a $$anonymous$$ute with the level's basic geometry, a standard Empty Game Object with a Character Controller attached and the $$anonymous$$ain Camera parented to it. The canvas settings and the text displayed are not altered, save for the text and the text's appearance. (No Oculus-specific things in the scene.)

The text shown in the Scene window does not display in the Game window, nor in the Oculus (which actually still works to view the scene, even without the OVR kit).alt text

unity-question001.jpg (151.0 kB)
avatar image ZefanS Ereptor · Dec 03, 2015 at 12:56 AM 0
Share

Also, as an aside, Unity has built-in Oculus support as of 5.x so you don't need any OVR*** stuff anymore. Any default camera will work as long as you check Virtual Reality Supported in the Player Settings.

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by ZefanS · Dec 03, 2015 at 12:53 AM

You're not actually doing anything wrong with the GUI per say, but using the traditional GUI with the Oculus Rift is somewhat equivalent to trying to glue some text to the player's eyeballs - it just doesn't really make sense, because there's no "screen" in the traditional sense. Thus when you have virtual reality mode activated all on-screen GUI stuff gets deactivated automatically. Designing GUIs in VR is actually somewhat different than designing a traditional GUI because it will have to exist in the world as opposed to on top of the world. I have yet to try, but as far as I know the built in GUI system does allow you to create GUI elements that exist as part of the 3D scene. This type may be view-able with the Rift. Otherwise, I would highly recommend the package available in this thread. I haven't tested it with the most recent versions of Unity / Oculus plugin, but it worked for me in Unity 5.1 at least.

Hope this helps.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ZefanS · Dec 03, 2015 at 01:07 AM 0
Share

I did a little test and setting your Canvas's render mode to World Space will allow it to be seen in the Rift. All you need to do then is scale and position it correctly and then make it a child of the camera to have to appear like a traditional GUI. It will however, be occluded by objects in the scene. $$anonymous$$aking an interactive GUI will prove more challenging, but you could do things like use a Raycast to activate buttons with the user's gaze, or create a custom mouse cursor as a UI.Image and a script to control it. There are lots of possibilities. GUIs are certainly one of the areas that have plenty of room for innovation in VR.

Note that the package linked above takes the latter route of implementing a custom mouse-controlled cursor.

avatar image ZefanS · Dec 04, 2015 at 01:53 AM 0
Share

Here's some relevant info from Oculus: https://developer.oculus.com/blog/unitys-ui-system-in-vr/

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

44 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to Render Unity UI Canvas in between two 3D Objects? 0 Answers

[VR] How to display a canvas with Oculus 5 Answers

Screen Space - Camera Bug (Buttons does not work) on Unity 2017 0 Answers

New UI(=uGUI) depth problem with particle 0 Answers

How to set the UI Text position to be relative to his "grandfather" prefab 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges