How to assign HUD Text to javascript object dynamically created in code?
I do this in my project to create a new game object via code in javascript:
var Zombie:GameObject;
Zombie=Instantiate(createThis[rndNr], transform.position, transform.rotation);
I was trying to do this to assign the script to my Zombie GO, but I get a compile error saying the type "HUDText" isn't found:
var myHUD : HUDText; //<< compile error
Zombie.AddComponent("HUDText");
myHUD = Zombie.GetComponent("HUDText");
myHUD.Add(-123f, Color.red, 0f);
Thanks,
Tony