Progress bar speed

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By OlegM

Hello, I have a question about changing the speed of the progress bar.
So far, I just multiply delta by 100 to make it move faster

func _physics_process(delta):
if should_process_survey():  #  survey process
	surveyProgress += delta*100

But I was wondering if there is a more elegant, or centralised solution, since I have a lot of progress bars, and its quite tedious to adjust them one by one.

Thank you in advance

Have you looked into using a Tween?

Ertain | 2022-10-11 12:24

What does the progress bar represent? A progress bar is normally used to visualize, well, progress of some operation / process. So, the “speed” of the progress bar is just driven by the speed of completion of the thing its monitoring.

jgodfrey | 2022-10-11 15:25

From what I understoon from the documentation it would just make the movemen of the bar smoother, or am I wrong?

OlegM | 2022-10-12 14:19

Usually - yes, in my case its just a visual effect, you press the button and the progress bar is filled to visualise that something is happening. From what I understand, the speed depends on the delta parameter, but I cant figure out how to change the delta itself, so I just multiply it by 100. Im just not sure, that what Im doing is the best practice

OlegM | 2022-10-12 14:25

:bust_in_silhouette: Reply From: godot_dev_

You could export a variable (export (float) var speed=100) in a progress bar script, so you can control the speed using that. Or you could just define some constant in a singleton/global script where every progress bar uses that constant, and changing it will change the progress speed of each bar.