void Shoot() { RaycastHit hit; if (Physics.Raycast(camFps.transform.position, camFps.transform.forward, out hit, range)) { if (mun > 0) { mun--; municion.text = "Municion: " + mun + "/100"; EnemyDamage target = hit.transform.GetComponent <EnemyDamage>(); if (target != null) { Debug.Log(target.name); target.takeDamage(damage); } } } }