void Update() { if (Input.GetMouseButtonDown(0)) { float posX = _camera.pixelWidth / 2; float posY = _camera.pixelHeight / 2; Vector3 point = new Vector3(posX, posY, 0); Ray ray = _camera.ScreenPointToRay(point); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { GameObject hitObject = hit.transform.gameObject; ReactiveTarget target = hitObject.GetComponent <ReactiveTarget>(); if (target != null) { target.ReacToHit(); } else { StartCoroutine(ShpereIndicator(hit.point)); } } } }