- Home /
Raycasting with Google Cardboard
Hey everyone, sort of a coding newbie here
All I'm trying to do is have a raycast from a camera of the Google Cardboard main prefab to objects in the scenes. Here is the code for that in particular: Ray rayOrigin = GetComponent().ScreenPointToRay(transform.position); RaycastHit hitInfo; if(Physics.Raycast(rayOrigin,out hitInfo)) { //Debug.Log ("Ray hit!"); //Debug.DrawRay(hitInfo.point,rayOrigin.direction,Color.white,Mathf.Infinity); if(hitInfo.collider.tag == ("Gone Wrong")) { Debug.Log("looking at it!"); } }
My question is...now what? There seems to be a lot of cameras on this prefab, so I'm not quite sure which one is going to work for that. Could someone with experience with this tell me how to implement this correctly? Or, if I'm completely wrong, what exactly to do?
Very greatly appreciated!
Your answer
Follow this Question
Related Questions
playing audio with the GoogleVR Reticle Script 0 Answers
GUIText and Raycasting with google cardboard 0 Answers
A Quick Question About 2D Enemy AI 0 Answers
embed google maps into unity 3d 4 Answers