I am working in Godot 4.0, and having issues with the TextureProgressBar. In order to recreate this issue, make a new project, create a new scene as a Node2D, and add the children Timer and CanvasLayer. Then give the CanvasLayer its own child, a TextureProgressBar. Add a gdscript file to the Node2D and connect the Timer's timeout() signal to it (I changed the name of the timer to StartTimer, the CanvasLayer to Loading Screen, and the TextureProgressBar to Loading Bar, which is why the func call name is different in the provided code). Then replace the code in the script file with this:
extends Node2D
func _ready():
get_node("Loading Screen/Loading Bar").position = Vector2(200, 360)
get_node("Loading Screen/Loading Bar").set_value(1)
func start_world_creation():
start_progress_bar()
func start_progress_bar():
for x in 100:
for y in 100:
for time_waster in range(20000):
time_waster += 300
get_node("Loading Screen/Loading Bar").value += 1
print(get_node("Loading Screen/Loading Bar").value)
func _process(delta):
pass
func _on_start_timer_timeout():
start_world_creation()
Finally, assign the images below to their respective places for the TextureProgressBar:
For some reason, the TextureProgressBar does not update until its value reaches 100. Why is this, and how can I fix it? According to the documentation, it should update with every integer increase in value, since the TextureProgressBar's step value is set to 1, and max_value is 100.