0 votes

I did an interactive download of resources.
If I start debugging (Editor) on android it does not work.
Error 18, if I use "Wait"
I get null if I use "Poll"

Good code, is work!

extends Node
class_name AS_ResourceManager

static func load(path : String) -> Resource :

    var res = ResourceLoader.load(path)
    if res == null :
        CoreSceneManager.show_error_scene("Resource " + path + " resource is null!");

    return res;

Bad code, is dont work!

static func load(path : String) -> Resource :
    var interact = ResourceLoader.load_interactive(path)
    var err = interact.wait() #or poll()
    if err != OK : #if poll err != 18 and err != OK
        CoreSceneManager.show_error_scene("Resource " + path + " resource err: " + String(err)) #if wait, this error!
        return null

    var res = interact.get_resource()
    if res == null :
        CoreSceneManager.show_error_scene("Resource " + path + " resource is null!"); #if poll, this err!
        return null

    return res;
in Engine by (35 points)
edited by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.