Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);//传参为在屏幕上触摸的坐标//打印射线,只有在scene视图中才能看到Debug.DrawLine(ray, Color.white);RaycastHit hit;if (Physics.Raycast(ray, out hit)){ //Debug.Log(hit.collider.gameObject.name);}