Having problems with damage script

Hi i’m trying to make a damage script where when an arrow hits the target that bodypart will take damage.
However i can’t seem to get this to work and i don’t know why.

Hit script

    private void OnTriggerEnter(Collider other)
    {
        Embed();
        if (other.CompareTag("Animal"))
        {
            transform.parent = other.transform;

            Debug.Log(other.name);

            Health hitHealth = other.GetComponent<Health>();

            if (hitHealth != null)
            {
                hitHealth.TakeDamage(arrowDamage);
            }

        }
        Debug.Log(other.name);
    }

TakeDamage Script

    public float partHealth;


	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
        
	}


    public void TakeDamage (float amount)
    {
        partHealth -= amount;

        Debug.Log("I " + transform.name + " took " + amount + " damage, and have " + partHealth + " hp left");

        if (partHealth <= 0)
        {
            Debug.Log(transform.name + " part died");
        }
    }
}

There doesn’t seem to be anything wrong with the collisions since when i hit an object it returns the name but i can’t affect the script in any way :confused:

Ok, but where exactly does it fail? Code looks ok. Are you sure there is a Health component on other gameobject? Is arrowDamage greater than zero? Does the other object have “Animal” tag?

Also if a collider is on the body part which is a children of an object with Health component, you will not succeed. In this case you will have to use GetComponentInParent