0

I'm making a prototype game that involves a menu and a main scene. And while the main scene isn't big enough that the get_tree().change_scene("res://Main.tscn") thread block is a problem, I wanted to develop a loading so that I can show this functionality working.

The issue is that the loader.poll() isn't loading all "polls" (it loads 8 out of 9).

I've looked at the docs from the Godot, and I still havet found the issue neither how to solve it.

Thanks a bunch for the help! :)

Here is the function that loads the scene

func load_scene(scene_path): #receives the path to the next scene
    var loader = ResourceLoader.load_interactive(scene_path)

    #Disable some buttons and displays the progress bar animation
    $Animation.visible = true

    $X.disabled = true
    $Creditos.disabled = true
    $About.disabled = true
    $PlayButton.disabled = true
    $Sair.disabled = true

    while not loader.poll():
        var percentage_complete = (loader.get_stage()*100.0)/loader.get_stage_count()
        $Animation/Label/ProgressBar.value = percentage_complete #updates the progress bar

1 Answers1

2

Well, dumb me was counting the times that the code entered the while, and so, it would be always one less... Problem solved... :D