i’ve seen this script already(Change value one prefab NOT ALL - Questions & Answers - Unity Discussions) which i dont think helps me much because its quite pointless since every single enemy in the game will have 2 hp which is dumb, and it doesnt work for me the way i want to
basically i have a script called EnemyControl
and a global variable:
public static var EnemyHP : float;
i have different prefab enemies sharing the same EnemyHP variable; the damage script work fine with a simple
function OnTriggerEnter (EnemyCollision : Collider)
{
if (EnemyCollision.tag == "Missile")
{
EnemyHP = EnemyHP - Fire.MissileDamage;
}
}
what i want to know is how to increase ONE of the prefab’s EnemyHP when i go to stage2 for per say
So in short, i have for now a flyerEnemy prefab and a zombieEnemy prefab and only want to increase the flyerEnemy’s HP once i reach stage2 knowing they share the same EnemyHP variable.