void Fire() { RaycastHit hit; if (Physics.Raycast(camera.transform.position, camera.transform.forward, out hit)) { Orc orc = hit.transform.GetComponent <Orc>(); if (orc != null) { orc.Kill(); } } }
void Fire() { RaycastHit hit; if (Physics.Raycast(camera.transform.position, camera.transform.forward, out hit)) { Orc orc = hit.transform.GetComponent <Orc>(); if (orc != null) { orc.Kill(); } } }