I am currently making a bitcoin miner idle game. In the game you are able to transfer the bitcoin in your miner to your wallet. The issue is when it adds the bitcoin in the miner to the wallet it sets the bitcoin in the miner to 0 (which is what I want) but it doesn’t add the bitcoin in the miner to the wallet. The bitcoin in the wallet still stays zero. Help please!
I’m setting it to 0 on the bitcoin miner. Not the wallet. Even without that line of code it doesn’t work. I’m pretty sure the issue has something to do with line 6. Or maybe I’m just being dumb, I dunno.
I think you have your addition the wrong way around:
Mine.Instance.btcAmount += btcInWallet;
Unless I am mistaken, this looks like it is adding the value in btcInWallet to btcAmount (which is then zeroed out a couple of lines later).
You probably want: