Created
November 12, 2014 10:13
-
-
Save dakom/aa351d0e9af77046cc18 to your computer and use it in GitHub Desktop.
Test Unity touch info even if not hitting current collider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://answers.unity3d.com/questions/425478/onmousedown-not-firing.html | |
void Update () { | |
if (Input.GetMouseButtonDown (0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { Debug.Log ("Name = " + hit.collider.name); Debug.Log ("Tag = " + hit.collider.tag); Debug.Log ("Hit Point = " + hit.point); Debug.Log ("Object position = " + hit.collider.gameObject.transform.position); Debug.Log ("--------------"); } } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment