get object tag when raycast hit in unity code example
Example: how to see a tag of what you hit with raycast
if (Physics.Raycast (transform.position, fwd, hit, Reach) && hit.transform.tag == "TagName") {
if (Physics.Raycast (transform.position, fwd, hit, Reach) && hit.transform.tag == "TagName") {