private void Shoot() { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Input.GetKeyDown(KeyCode.Space)) { if (Physics.Raycast(ray, out hit, 10)) { Debug.DrawLine(ray.origin, hit.point); } proj.CreateBullet(); } }