Minor re-fueling visual problem (Bens rocket game on the 3d course)

hello everyone! i have just finished the 3rd sector (rocket) of the 3d course by Ben Tristem and i have a minor problem . i have created a fuel system and a fuel station and it works just fine !
the only problem is when im re-fueling on the station i can see the fuel bar changing only when i stop the refuel … its annoying that you cant see the fueling progress :confused:

any suggestions ?
btw its my first unity course so my knowledge is really limited :x

this is code for the fuel consume, bar , and refuel



btw for the fuel bar i used Brackeys tutorial on youtube for health bars

Hi Danik,

Welcome to our community. :slight_smile:

Please note, it’s better to copy/paste your code and apply the code fencing characters, rather than using screenshots. Screenshots are ideal for displaying specific details from within a game engine editor or even error messages, but for code, they tend to be less readable, especially on mobile devices which can require extensive zooming and scrolling.

You also prevent those that may offer to help you the ability to copy/paste part of your code back to you with suggestions and/or corrections, meaning that they would need to type a potentially lengthy response. You will often find that people are more likely to respond to your questions if you make it as easy as possible for them to do so.

Have you already added Debug.Logs to your code to see if the methods and code blocks get executed as expected?

Hope this helps :slight_smile:


See also;

well thanks for the tips ! and as i said,it all works fine but the bar fills back only when i leave the fuel station

The “but” indicates that not everything is working fine meaning as planned. :wink:

Did you implement the fuel bar should be “filling” while the rocket is standing on the platform? Or didn’t you implement that yet? I’m not quite sure if I understood your problem.

By the way, I cannot see the Lerp method anywhere. Maybe that’s what you are looking for.

thank you !!! i just got it… the fuel bar change happened only on GetKey, so i just called it from the update and it solved it :slight_smile:

anyways thanks for the tips, my next thread will be better :stuck_out_tongue:

Good job! :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms