• 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 Sir-Gatlin · Jul 11, 2017 at 03:18 AM · raycastgooglevirtualrealityhover

know when GVR raycaster is looking at nothing

So I am building a vr video player for cardboard. I have made a pause menu that pops up when you pause it, but I want you to be able to look off the menu and click on the video and it go back to playing and hide the pause menu. I assume the best way to do that is to (when not looking at anything and button pressed hide menu) I tried OnGvrPointerHover but that only shows you when you are hovering over the specific object that has that code on it. I just want to be able to know when the player isn't looking at any item in my pause menu. hover = null kinda thing. I know there is something that is telling the reticle to enlarge or shrink, I want to know what makes it shrink! "when reticle is tiny and clicked do this".

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 Jwizard93 · Jul 11, 2017 at 03:30 AM 0
Share

GVR DOC

Here in this doc it says the GVRREticuleObject has a function which is called when the user pulls the trigger. Idk how to use it but maybe if you did it would help you. Or maybe you can just put a gameobject in between the UI elements and the video screen and make it invisible to the renderer.

avatar image Sir-Gatlin Jwizard93 · Jul 11, 2017 at 07:00 PM 0
Share

I thought about the invis UI element, but then the reticle would react as if it was over an object, and I didn't want that.

1 Reply

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

Answer by Sir-Gatlin · Jul 11, 2017 at 05:27 PM

What I ended up using was some code I found on a forum. to be honest not 100 sure how its working but I know its reading a raycast from the camera and will list everything it sees in the list, so I am checking if the list is empty, if so then I must be looking off the menu and if they tap the screen it will properly close the pause menu when you click off of the menu itself

 PointerEventData pointer = new PointerEventData(EventSystem.current);
                 pointer.position = Input.mousePosition;
 
                 List<RaycastResult> raycastResults = new List<RaycastResult>();
                 EventSystem.current.RaycastAll(pointer, raycastResults);
 
                 if (raycastResults.Count == 0 && poppedUp == true)
                 {
                     hide();
                     player.Play();}
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

98 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

VR navigation like google maps 0 Answers

Black patches in skybox when VR mode is enabled 0 Answers

Build Failed due to failure to install Cocoapods? 5 Answers

Am I using the PlayerSettings.virtualRealitySupported check wrong? 0 Answers

How to Spawn Prefab on Mouse Click 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