#Progress bar refresh issues

1 messages · Page 1 of 1 (latest)

turbid rune
#

i dont really undersatnd how your combo meter goes down in jumps like that

quaint creek
#

Me neither

turbid rune
#

is that the only place you set something with the combo meter

warm patrol
#

What sets draining_combo?

quaint creek
#

It doesn't turn off yet

turbid rune
#

@onready var progress_bar: ProgressBar = $ProgressBar
var actual_value : float
func _ready() -> void:
pass

func _process(delta: float) -> void:
actual_value += 1 * delta
progress_bar.value = lerp(progress_bar.value, actual_value, 5 * delta)

tjis is what i did

#

this works fine for me

warm patrol
#

Something to keep in mind, this is going down by 0.5 per frame.
That means it goes down by 30 per second at 60 FPS.

The speed is dependant on frame rate as it stands.

turbid rune
#

yeah have to * delta

warm patrol
#

wait, why lerp()?
@turbid rune

turbid rune
#

to smooth it out maybe

#

idk

#

i just did that quickly

quaint creek
turbid rune
#

i mean its going down

#

but very slowly

#

make the actual_progress bigger like make it 5 * delta

#

also in your progress bar change step back to 0.01

quaint creek
turbid rune
#

i dont get it

#

thats weird

#

did you change step in the progress bar node

#

change it back to 0.01

quaint creek
#

Yep

#

I did that , refreshed the project and pressed play

turbid rune
#

and its still going down in jumps

quaint creek
#

Yeah :/

turbid rune
#

idk. thats weird

#

i have no idea

#

maybe bug

quaint creek
#

Let's see if someone else has any ideas

#

If I don't find any solutions im reporting that to the bug channel

naive sphinx
#

I'd try to isolate the whole progressbar, or recreate the progressbar code in a new scene with simpler scripts, and test just that, to see if it is not something else in the other scenes that is causing issues
I did a very simple scene test and the progress looks smooth
Code:

extends Node3D

var value = 100.0 # holds the value that will be assigned tothe bar. Not required, but it's just for the test
const FACTOR = 10.0 # just a fixed factor to simplify things
@onready var combo_meter: ProgressBar = $CanvasLayer/combo_meter

func _ready() -> void:
    combo_meter.value = value # starts the bar full

func _process(_delta: float) -> void:
    if (Input.is_action_pressed("ui_left")): # if left arrow is being held down
        value -= (FACTOR * _delta) # decreases value
        combo_meter.value = value # updates the bar value
#

It only looks choppy if the step is too high (10, for example), because then Godot will only update the bar when the value is rounded to the required step

quaint creek
#

Ill check it out hold on

quaint creek
#

I copy pasted the code and xonnected everything the right way

#

It runs fine , and the debug cod successfully flags that the input key is pressed and prints the combo_meter.value

naive sphinx
#

You're running Godot on Android? @quaint creek

#

Sorry if I missed that, my test was in Windows

quaint creek
naive sphinx
#

I also asked that because it might be something that only happens when running on Android, so you might want to add that information if you open an issue

quaint creek
#

At #🐞┃is-this-a-godot-bug ?

naive sphinx
#

is-this-a-bug is for discussing if something is a bug before opening an issue. You can ask there again and give more info, linking this thread, and more people can see if they have any idea if something is a bug or not
The issues itself you would open on Github https://github.com/godotengine/godot/issues , but only after testing a lot, and searching to see if there's no similar issue already open