获取鼠标点击的位置

void Update () {
        if (Input.GetMouseButtonDown(1))
        {
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast(ray,out hit))
            {
                Debug.Log("鼠标右击点击位置" + hit.point);
            }
        }
    }

你可能感兴趣的:(获取鼠标点击的位置)