I use a raycast in my gun script and if it hits a gameobject with the tagg zombie it has to send a message to that gameobject to apply damage I can send messages and detect if somthing is hit but it doesn’t recognise the tag.
here is my code to detect the hit:
if (Physics.Raycast(transform.position, fwd, 10)&& tag == Zomie) {
print("hit");
gameObject.Find("Zomie").SendMessage("ApplyDamage");
}