How to add "Fuel system for Rolling Ball"?

Hello all!

I’m trying to implement a Fuel System for my Rolling Ball. The current way of controlling the rolling ball is by adding Torque in radians. However, I wanted the input for forward movement to be limited, just like a fuel system where I can roll the ball forward as long as I have fuel, which regenerates.

Create a variable to represent fuel, and simply decrease it by the amount of torque applied over time. You can use a scalar to adjust the torque value to be in line so that you can achieve an appropriate rate of burn that would be good for your game. Then you can create a simple script to add fuel back over time in your fuel variable by checking to see if torque is being applied (if so do nothing), and if not, add fuel back to the variable, until the fuel is full.