Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Update () {
- if(Input.GetButtonDown("Fire1"))
- {
- var ray : Ray = GameObject.Find("MainCamera").camera.ScreenPointToRay(Input.mousePosition);
- var hit : RaycastHit;
- if(Physics.Raycast(ray, hit))
- Debug.Log(" " + hit.transform.gameObject.name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement