|
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#!
(comments are locked)
|
|
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 Please format your code.
Aug 09 '11 at 10:07 PM
Chris D
Oops, will do for now on
Aug 09 '11 at 10:56 PM
gregmax17
(comments are locked)
|

You're not going to get much (useful) help until you post code. That said, are you using
staticvariables for your health? If so, don't.