The question is answered, right answer was accepted
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.
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.