Variable value not changhing

The variable value is not changhing and it is really weird i need help.

So…

TotalBullets = TotalBullets + AmmoFromBoxes;

and

TotalBulletsText.text =“”;
TotalBulletsText.text += TotalBullets;
// kinda weird but thats how i do it

well the variable value does not change. the text remains the same. if i do

Debug.Log(TotalBullets);

in

void Update()

then the value goes one frame the previous amount and the other frame the amount that it should be.

150
120
150
120
150
120
…you get it

if i do it again

180
120
180
120

And if i just

Debug.Log(TotalBullets);

after the variable increase it gives me the right value everytime…

TotalBullets is private

I tried many things but it seems like this is a bug.
I am using unity version 5.3.5f1.

Pls help

@username
use TotalBulletsText.text = TotalBullets.tostring();
it will helps

you have to configure the base of the starter i think.

So…i replaced the variable TotalBullets with PlayerPrefs.GetInt(“TotalBullets”) so now it works but i still want to know why it did not work with the variable … its very weird i checked it multiple times and i think its a bug …
But yea thx