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
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 things, I just made a canvas in Screen Overlay mode and added a button on top, leaving all the defaults (except for changing the highlight color to something more noticeable than just white). I can hover over it just fine. However, when I change the canvas to World Space (which 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 third picture showing that pressing the very bottom of the button WILL cause it to highlight, but apparently only a max of 2 pictures are allowed. Point is, the clickable region of the button has shifted, and I think moving my head around with the VR headset will also change the clickable region. I have no idea where this 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! this 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

I'm not sure if it is related but the same occurs to me simply by changing the aspect ratio of the screen (not in VR). It is fine in a 16:9 resolution but the button will be slightly offset in a 4:3 resolution. It does the same in the editor and in a build. Could be a bug in Unity. (version 5.3.4f1)

avatar image BrandonYJ · May 29, 2017 at 10:16 AM 0
Share

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

avatar image Tudor · Jun 04, 2017 at 03:57 PM 0
Share

Still happening in 5.6.0. If you set a canvas to worldpsace, the hover / clickable area will be offset randomly if you: move the canvas around in the scene Z wise or otherwise, or change the size of the viewport by resizing the window, or change the aspect ratio from the dropdown. It also happens on unity's own UGUI project sample scenes (you just open it and it doesn't work) or an empty scene. JESUS CHRIST UNITY

avatar image abdulthegamer · Jun 09, 2017 at 03:18 AM 0
Share

Try : Remove eventsystem component and add it again after changing from screen space to world space.

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 nothing but one camera and one canvas + eventsystem + button.

So drag your GUI / Main camera into that field. However, when I tried to do this, 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, which 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

That made the screen become black.

avatar image
0

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

Glad to know I am not the only one with this 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" which 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.

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

UI canvas attached to vive controller disappears after first run in editor on vive 0 Answers

Clickable Worldspace UI Buttons? 1 Answer

How to make a world canvas visible only from front side in a VR game ? 0 Answers

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

World Space UI as an in-game computer screen! 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