Send Message On Collision

Ive been messing around with this part of code to make this work with a collision of my weapon, instead of raycast because my game is thirdperson, any ideas how I can change this script? Thank you!

#pragma strict

var rayLength = 10;

private var treeScript : TreeController;

function Update()
{
	var hit : RaycastHit;
	var fwd = transform.TransformDirection(Vector3.forward);
	
	if(Physics.Raycast(transform.position, fwd, hit, rayLength))
	{
		if(hit.collider.gameObject.tag == "Tree")
		{
			treeScript = GameObject.Find(hit.collider.gameObject.name).GetComponent(TreeController);
			
			if(Input.GetButtonDown("Fire1") && playerAnim.canSwing == true)
			{
				treeScript.treeHealth -= 1;
			}
		}
	}
}

You must have rigidbody and collider/trigger on your tree and a collider with your weapon.

You keep your animation of weapon when the player Fire1. But weapon in these script will have a function :

void OnCollisionEnter(Collision collision) 
{
        if(collision.gameObject.tag == "Tree")
treeScript.treeHealth -=1;
        }