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
0
Question by fmielke · Nov 03, 2016 at 07:56 AM · uiraycastvrunity5

Raycast a World Space UI with VR (Daydream)

Hello,

need some help with raycasting UI with Daydream. As there are only a demo for gameObjects (cubes), I want to know I can handle UI elements. The UI elements should react as usual, I mean highlighted and so on. The posts in http://stackoverflow.com/questions/39087609/how-to-use-graphic-raycaster-with-worldspace-ui were helpful, but completely.

I used DrawRay to see where my pointer is actually going through and it works good. But no log message is created.

 void Update()
 {
     Quaternion ori = GvrController.Orientation;
     Vector3 vector = ori * Vector3.forward;
     Debug.DrawRay(transform.position, vector * 100000, Color.green);

     PointerEventData pointerData = new PointerEventData(null);
     pointerData.position = vector;
     Debug.Log(vector);

     List<RaycastResult> results = new List<RaycastResult>();
     EventSystem.current.RaycastAll(pointerData, results);
     if (results.Count > 0)
     {
         Debug.Log(results[0]);
     }
 }

Canvas (World Space) and Button is created as useal and not modified.

Thanks for your help!

PS: Maybe @faken or @Umair M reads this and can help.

Comment
Add comment · Show 2
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 mathias_strsser · Dec 14, 2016 at 10:18 PM 0
Share

I'm having the same issue. Were you able to resolve this?

avatar image fmielke mathias_strsser · Dec 14, 2016 at 11:26 PM 0
Share

Have a look to https://forum.unity3d.com/threads/using-the-controller-to-interact-with-unity-ui.443927/

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Tibor0991 · Apr 28, 2017 at 02:50 PM

On the Canvases you should add the "GvrPointerGraphicCaster" component, and disable the "Canvas Graphic Caster" component. Afterwards you should be able to interact with your UI as though as you were using a mouse pointer.

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

6 People are following this question.

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

Related Questions

Unity Xr Mesh Raycast,Unity XR Mesh Raycast 0 Answers

XR UIHelpers Eventsystem ray is coming out of my main camera rig instead of my hands 0 Answers

Worldspace Scroll View with Buttons in VR (Gear) 0 Answers

How to access menu button in vive by using steamvr player 1 Answer

Unity 5: How to display bird eye view layout of a 3D scene with UI component overlay on screen? 1 Answer


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