![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | IHate |
I was trying to add 10 to the value of a progressbar every second in order to hit 100 every 10 seconds. In order for the progressbar to look smooth I was using:
func _process(delta):
ProgressBar.value += delta*10
With this method filling the bar took almost 20 seconds but using this second method with a useless variable inbetween speeds up the process filling the bar in 10 seconds.
var value
func _process(delta)
value += delta *10
ProgressBar.value = value
Then I realised that this problem doesnt occur in _physics_process and I can use the first method and reach 100 in 10 seconds.
For what I understand the difference between process and physic_process is that _process is computed as fast as possible every frame while physic_process is computed at regular times so it always has the same delta time. I read that the delta time is not very precise but I didn’t expect for this function to take almost twice as long in _process than in physic_process
So am I missing something? is this a bug?
you probably have a low fps on that project oh wait nvm
Ultra8Gaming | 2021-03-30 08:46
I also encounter it but in my bullet. I tried to not multiply the delta to my speed and it is fast. But by the time I try to multiply it, it become slower
Mrpaolosarino | 2021-04-01 13:18
Try set “step” in ProgressBar
to 0 (or something very very small)
If you have a very high FPS, delta becomes very small. The standard-value for “step” is 0.01. If 10.0 * delta < 0.01
you will have problems.
Thats the only problem is can find there, because you first snippet of code is correct.
whiteshampoo | 2021-04-05 07:42