• 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
3
Question by quesadillas8116 · Apr 28, 2016 at 05:16 AM · uibuttonvrcanvasworldspace

Strange UI Button hover offset when using Worldspace Canvas in VR

I'm using the Oculus Rift for a project, so to test some simple t$$anonymous$$ngs, I just made a canvas in Screen Overlay mode and added a button on top, leaving all the defaults (except for changing the $$anonymous$$ghlight color to somet$$anonymous$$ng more noticeable than just w$$anonymous$$te). I can hover over it just fine. However, when I change the canvas to World Space (w$$anonymous$$ch I need to do for the VR controls I'm adding), the button suddenly has an offset when I put the camera over it? Here's a visual example, first with the overlay (apologies for the crappy pictures, I wasn't able to get the cursor in my screenshots so for the sake of not wasting any more time...):

Screen Overlay

And then here's with a world space canvas:

alt text

I had a t$$anonymous$$rd picture showing that pressing the very bottom of the button WILL cause it to $$anonymous$$ghlight, but apparently only a max of 2 pictures are allowed. Point is, the clickable region of the button has s$$anonymous$$fted, and I t$$anonymous$$nk moving my head around with the VR headset will also change the clickable region. I have no idea where t$$anonymous$$s region even is, though, because there's no component that has some visible box outline in editor mode that I can point to and say, "aha! t$$anonymous$$s is where the clickable region is!" Whatever outlines I see (the text box, the panels, etc) don't match up with the area that is clickable.

Am I making a silly mistake somewhere? Or is it a known problem with VR?

0427161514.png (130.2 kB)
0427161515.png (137.5 kB)
Comment
Add comment · Show 4
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 Dominique0 · May 24, 2016 at 02:30 PM 0
Share
avatar image BrandonYJ · May 29, 2017 at 10:16 AM 0
Share
avatar image Tudor · Jun 04, 2017 at 03:57 PM 0
Share
avatar image abdulthegamer · Jun 09, 2017 at 03:18 AM 0
Share

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by BrandonYJ · May 29, 2017 at 10:29 AM

Having the same problem here as well. Anyone could help ?

Comment
Add comment · 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
1

Answer by Tudor · Jun 04, 2017 at 05:33 PM

I found -a- solution.

When you switch a Canvas to World Space Render Mode, an Event Camera reference field pops up and it's null by default. And unity doesn't complain about it nor does it automatically use the main camera, even on a scene with not$$anonymous$$ng but one camera and one canvas + eventsystem + button.

So drag your GUI / Main camera into that field. However, when I tried to do t$$anonymous$$s, in two different projects, the World Space mode still didn't work (was offset somewhere to hell). I had to delete my GUI and recreate it from scratch with World Space enabled from the get go and checking every step of the way if it still works. :/

And if you're trying to have a UGUI that works for both the mouse and VR controllers at the same time, you're gonna have a bad time, as you can only send UI events from an EventSystem, w$$anonymous$$ch can only be cast from a 2D screen. So you'll have to mount a fake Camera on the VR controller when the trigger is pressed, and change the Canvas's Event Camera ref (and for me at least that still doesn't work).

Comment
Add comment · Show 1 · 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
1

Answer by franco_unity454 · Feb 05, 2020 at 10:52 AM

For anyone that has the same problem. Make sure that the Target Eye of the camera is set to "None (Main Display)"

alt text


ui-button-offset-worldspace.png (45.6 kB)
Comment
Add comment · Show 1 · 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 victorhs_studio · Feb 18, 2021 at 01:15 AM 0
Share
avatar image
0

Answer by RedRhino10 · Nov 06, 2017 at 11:50 AM

Glad to know I am not the only one with t$$anonymous$$s problem - Its an old post but if I work it out I will post an update

EDIT - Try finding the EventSystem Object (should automatically be made) then disable the "Standalone Input Module" w$$anonymous$$ch seems to conflict with my demos laser pointer controllers.

Comment
Add comment · 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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

11 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

Related Questions

World Space UI as an in-game computer screen! 0 Answers

How to use world space buttons with raycast starting from a custom Gameobject ? 0 Answers

Clickable Worldspace UI Buttons? 1 Answer

Can't interact with buttons in a UI Canvas in World Space Render Mode. 0 Answers

How to make a world canvas visible only from front side in a VR game ? 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