diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index b9d5910ea7e..fe26dca23da 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -2278,11 +2278,16 @@ bool GDInstance::get(const StringName& p_name, Variant &r_ret) const { } { - const Map::Element *E = script->constants.find(p_name); - if (E) { - r_ret=E->get(); - return true; //index found + const GDScript *sl = sptr; + while(sl) { + const Map::Element *E = sl->constants.find(p_name); + if (E) { + r_ret=E->get(); + return true; //index found + + } + sl=sl->_base; } }