#ResourceLoader is having issues!

11 messages · Page 1 of 1 (latest)

wooden crest
#

Hi! I'm trying to implement a loading screen for my 3D game, and I've been having issues. I've been looking around for a few hours for code examples and it seems that everything i've seen is essentially using something like this:

@onready var progress_bar:ProgressBar = $ProgressBar
@onready var progress = []
@onready var scene_load_status = 0
@export var scene:String 

func _ready():
    set_process(true)
    scene=Global.sceneHeading
        await get_tree().create_timer(1.0).timeout
    ResourceLoader.load_threaded_request(scene,"",true)

func _process(_delta):
    scene_load_status = ResourceLoader.load_threaded_get_status(scene,progress)
    progress_bar.value = progress[0] * 100
    if scene_load_status == ResourceLoader.THREAD_LOAD_LOADED:
        get_tree().change_scene_to_packed(ResourceLoader.load_threaded_get(scene))
        queue_free()```

Unfortunately, this has issues. The loading bar never moves, and I also have some text being animated by an animation player that stops as soon as loading starts. Both are set to always process. 
Additionally, I get a lot of errors. Sometimes things randomly aren't loaded or toss up an issue saying that there was a problem loading, or an error says there was an attempt to free an invalid ID. Materials will say "material_casts_shadows: Condition "!material" is true. Returning: true" among other things. Not sure what that means?

I went digging around Github and saw that there are maybe issues with the loader? But I am unsure. Is this a common error? Or is something about this loading code wrong?
ember wave
#

This was my approach, seems to work reliably even tho it does not differ much from your code

#

shrug

wooden crest
vital pelican
#

@wooden crest i have the same problem and i'm using @ember wave code too! did you solve it meanwhile? I compiled godot with double precision flag enabled, if you are using a custom build too, maybe that's a possible cause? if i have time i will try it with a official release download of godot next week and see if the code works fine there...

wooden crest
# vital pelican <@187343042284355594> i have the same problem and i'm using <@456226577798135808...

I'm using an official build of godot! A temporary fix for me was making sure that the load threaded request call doesn't use sub threads- I still get the errors but at least everything loads eventually. I feel like it's a specific recource that has trouble loading, but I'm not sure exactly what the issue is. I should test for it. Might need to make it as issue in github or something, not sure how that works though.

wooden crest
vital pelican
#

no, i'm not using any skeletons or rigs only simple meshes so far and no sub threads either... but i queue_free() a materiels somewhere there i think. i'll look into it next week. but thx!

wooden crest
#

I've been testing and that truly is the issue this time lol, more specific than just the rig

vital pelican
#

well it seems my error messages are all gone after booting today, but the progress is still troughout the hole loading at zero and no, i don't have any shape keys, just simple mesh primitives at the moment and no sub routines... maybe i'm missing something here: