Hey,
I’ve created a game where you can pick up weapons and they have an ammo count. With that I made a Text gameobject so the player can see how many bullet he has. However this text will only display a correct ammount if I pick up a weapon, then another and change from the latest to the first i picked up. The weapons get attached and disattached to the player gameobject accordingly. Any help is much appreciated. thanks.
public int AllBullets;
public int currentBulletsInClip;
void Start()
{
ammoUI.text = currentBulletsInClip.ToString() + "/" + AllBullets;
}
void Update ()
{
//ammo UI
ammoUI.text = currentBulletsInClip.ToString() + "/" + AllBullets;
}