Fuel System

Hi am trying to create a fuel system for my vehicle as well as a function where it goes down per second. I really don’t know where to start i would appreciate any help at all thanks.

it really depends on how your looking to implement it. at the most basic all you will really need is a timer and variable of type integer

I am sure you’d want this displayed to the HUD somehow, so you’d also want a widget with a progress bar and set the percent of the progress bar to the fuel variable (would need to be a float in that case) which you could then change using the above blueprint method.

thats true a float would work but you could also use a normalize to range node which would make it a 0-1 number. it all depends on how they want to implement and whats easier for them to work with. if they were to want different cars with different sized gas tanks and have fuel powerups then using integers may be easier.

6 to one half dozen the other i suppose.

edit: ok so with normalize to range it would still need to convert the integers to a float so i guess floats are probably a better bet in most cases.

Haha yea I just meant you need a float if you’re going to set the “percent” of a progress bar

I will give it a go. If i have any issues i will comment. Thanks again for taking your own time to help me out. I really appreciate it.