- Home /
Question by
CABRAS GAMES · Jan 20, 2012 at 12:48 PM ·
countammo
the count remains the same
Hi! I have these scripts that work well. Now when I click the mouse to shoot, the count remains the same, as at 16. I want a script that counts when I shoot a grenade at least until you get to zero.
1° script
static var GRENADE_AMMO = 0;
function OnControllerColliderHit(hit : ControllerColliderHit)
{ if(hit.gameObject.tag == "crateGrenades") { Destroy(hit.gameObject);
GRENADE_AMMO += 4;
print("YOU NOW HAVE "+ GRENADE_AMMO +" GRENADES");
GameObject.Find("g_Count").guiText.text = ""+GRENADE_AMMO;
}
}
2° script
function Awake() { guiText.text = ""+0;
}
Comment
Your answer
Follow this Question
Related Questions
What does the ammo count script mean ??? 3 Answers
adding ammo count 2 Answers
Ammo with ammobar problem. 0 Answers
GUI does not show my current ammo 0 Answers
How to add the needed amount to the AmmoCount (current ammo)? 1 Answer