void Punch() { RaycastHit hit; if (Physics.Raycast(cam.transform.position, cam.transform.forward, out hit, mRange)) { EnemyHealth target = hit.transform.GetComponent <EnemyHealth>(); if (target != null) { target.EnemyStruck(pow); } } }
void Punch() { RaycastHit hit; if (Physics.Raycast(cam.transform.position, cam.transform.forward, out hit, mRange)) { EnemyHealth target = hit.transform.GetComponent <EnemyHealth>(); if (target != null) { target.EnemyStruck(pow); } } }