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 /
  • Help Room /
This question was closed Jan 12, 2017 at 11:59 PM by malachi11 for the following reason:

The question is answered, right answer was accepted

avatar image
1
Question by malachi11 · Jan 08, 2017 at 06:31 PM · raycastvr

Raycasting not working for specific object in VR

So I've been having a bit of fun making an app for the Gear VR, but I've run into a problem... I have a cube that, when clicked on, plops a cube in front of it. This works fine in game mode, but not once I try it in the Gear VR... I'm checking the block with a script placed in the camera, making sure it has the tag "Interactable". If it does, it runs a function inside of a script in the object. I've tried simply trying to write the tag into a text UI element as well, and it says "Cube" when I click on something tagged "Cube", and it says "Untagged" when I click on something untagged. But when I click on the "Interactable" cube, it doesn't change. It's as if the raycast isn't detecting the cube. Here is a portion of my code:

 RaycastHit hit;
             if (Physics.Raycast(new Ray(transform.position,transform.forward), out hit, 50f))
             {
                 txt.text = hit.collider.gameObject.tag;
                 if (hit.collider.gameObject.tag.Equals("Interactable"))
                 {
                     hit.collider.gameObject.GetComponent<CreateCube>().Do();
                     return;
                 }
             }

txt is the Text UI that I'm using for debugging, and the script is in the main camera. Again, this works in game mode, but as soon as I put it in the Gear VR, it doesn't.

Comment
Add comment · Show 1
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 malachi11 · Jan 12, 2017 at 11:58 PM 0
Share

Ok, I think I figured it out. I changed the tag from "Interactable" to something else... $$anonymous$$aybe unity does something special with the tag "Interactable"... Anyway, it solved my problem.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

124 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 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

SteamVR and canvas interaction? 2 Answers

VR Selection of buttons only works once unless scene refreshed. 0 Answers

SteamVR Laser OnPointerClick not work with UI Element 0 Answers

Raycasting / Receiving problem 0 Answers

Trouble Raycasting elements in UI in Oculus 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