In your damage script in the OnTriggerEnter2D() function, you’ll just have to reference your enemies health script as well, just like you reference the enemies Animator (if I’m seeing that correctly). Is the HealthScript attached to your enemy gameobject?
If so, I think all you need to do is simply add this line underneath line 14 in your damage script:
col.transform.root.GetComponent().decreasehealth();
But…your decreasehealth function (as you have it there) is subtracting nothing from your health. So I’m not sure if you have “0” there as a placeholder, or if you need to change that. Also you have your variable “public float cur_Health =0;” as zero, so I’m assuming your setting that via the inspector or from some other code perhaps.
**Edit: If you’re wanting to apply damage and play the damage animation on the gameobject holding both of those scripts, then it’s even easier actually. But I don’t know if you’re trying to apply damage to an enemy gameobject from the enemies collider, or to the friendly gameobject from its own collider.
I’m making a fighting game and want both of them to lose health. Looks like I’m going to have to make a new player health script so that they can be separate. I have the 0 in place because if I add a number to it my player starts losing health on its own.