i have a lot of enemies, that are duplicates from each other.
and i have a script that selects the nearest enemy as target.
here is the problem:
i guess i need to make the target select script the attack script what target is selected,
but i have no idea how to do that.
everything is in c#!
Is the enemy health a static variable?
You could try something like this (in JS)
enemy.js attached to the enemy prefab:
This way when the bullet or whatever hits the enemy prefab, you call this function, dealing the damage to the health.
Hope this helps