Hey all,
I have a script that basically shows an enemy bosses life on the HUD, however I wish to change the health bar displayed for different enemies.
The problem is I would rather not create 100 HUD scritps for each individual enemy as that jsut doesn’t seem right.
So what I’m trying to do;
Is have my HUD object, with a HUD script attached.
in the inspector drag what ever enemy i choose, then the HUD will then access the script attached to the enemy and pull out ‘EnemyLives’. thing is I want it to access any script and not a defined one… i dunno if that makes sense.
Yet, in another scene, i can apply another script, and it would work…
so, something like:
private var Enemylives : float;
var McScript : Script; <--- attach gameobject carrying script in inspector. this is where im stuck.
fucntion start(){
Enemylives = McScript.lives;
}
Kinda stuck on this one.
Thanks, josh