private void ProcessRayCast() { RaycastHit hit; if (Physics.Raycast(FPCamera.transform.position, FPCamera.transform.forward, out hit, range)) { print(hit.transform.name); processHitFX(hit); EnemyHelth target = hit.transform.GetComponent <EnemyHelth>(); if (target) { target.hitPointsDecresser(weaponDamage); } } else { return; } }