Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | null_digital |
I’ve discovered that overriding _init() with arguments, like _init(val), causes whatever scene this script is attached to to load without the script on runtime. This error also appears:
E 0:00:00:0202 Condition ’ r_error.error != Variant::CallError::CALL_OK ’ is true. returned: __null
modules/gdscript/gdscript.cpp:129 @ _create_instance()
If I make all arguments optional, like _init(val = 0), the scene loads with script and no errors.
I’d like to know when it’s possible to override _init() with non-optional arguments. I couldn’t find anything on this subject.