aaaaah i see what you mean, i think!
So when the bullet with raycast detects that it has hit an enemy, it saves the hit target object as a GO variable "targetHit" and uses a sendEvent to that specific enemy - the enemy then adjusts it's own health var?
Will it work from the bullets POV to store targethit as a var and then send an event to that specific enemy?
BTW im not building GUI elements yet - I just need for the enemys to have their own health and be able to kill them individually
______________________________________________________________________________
EDIT:
looking back, im pretty sure i tried that before (saving the object hit as a variable and then sending an event to that specific enemy) and it didn't work - the variable didn't reference the specific enemy that i hit =(
Im so confused =(
_____________________________________________________________________________
I think the problem is that i have the hit-detection on the bullet - the bullet uses raycast to see if it hit a target and then compares that target to the tag "enemy" - if target hit = enemy then send an event to that enemy gameobject (which is not possible)
but how do i make the zombie itself have hit detection? I find that using colliders is very unreliable when the bullet moves fast, so a raycast from the bullet is much better at detection objects hit