Hi! I was wondering what code to write for what I want to do. I want to have it where if my enemy collides with an arrow, his health variable goes from 100 to 50, and if the enemy health = 0, then destroy enemy. I am still learning, and dont know how to write this out, thanks!
have an int on the enemy for its health & set to 100. When he is damaged lower it by 50. In your update use an if statement to check the health value & when it is <0 destroy the gameobject.
e.g.
if(playerHealth<=0) Destroy(gameObject);