Hey im using a GUI to display how many turrets the player kills but for some reason it wont count up heres the code for the gui:`function Update () {
var killCount: int;
var globalCounter : GameObject = GameObject.FindWithTag("GlobalVars");
killCount = 0;
if (gameObject.Find("SmallTurret").hit) {
globalCounter.killCount += 1;
print("kill count is now: "+globalCounter.killCount);
}
}`
and the code i put with the turret:
var explosion : Transform;
private static var numKills : int;
var killsDisplay : GUIText;
if(gameObject.tag == "wormProjectile")
{
numKills++ ;
Ooooooooook, please, no one write him a whole script...
Now, for the actual scripting for the kill count, you'll need a health system, or if it's one shot kill, you'll need to have to look at the collider API
Now, this should cover most of it... Their is also a Destroy() function to make the turret disapear and you can see the instantiate to make a "dead" turrent model appear in its place.