My code is suppossed to have a progressbar that will show you how full your storage is, but instead it says that the bits / capacity * 100 is 0, and only changes it to 100% once its at max, and i have no idea why. The code in question:
func _process(delta):
$Label.text = str(Bits)
Second += delta
if Bits > 0:
$ProgressBar.value = round(Bits / Capacity) * 100
print(round(Bits / Capacity) * 100)
if Second > 1:
Second = 0.001
if Bits < Capacity and Bits + Spark_Gens < Capacity:
Bits = Bits + Spark_Gens
if Spark_Gens > 0:
$AudioStreamPlayer.play()
else:
Bits = Capacity