-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Parser error: Could not resolve member" when a dictionary of preloads contains the scene trying to access said dictionary #90954
Comments
I've got a similar issue, in my case I store some resources that contain data about each different team the player can be part of. |
Bisecting points to #85501 as the culprit |
CC @Jordyfel @godotengine/gdscript |
See also #90362. |
For the MRP, my PR (#92326) fix it, but you need to make sure that you can save the global class without error (by commenting the autoload reference first) to make sure it's registered as a global class. Then, you can put back the commented line. |
Tested versions
System information
Godot v4.3.dev5.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated Radeon RX 570 Series (Advanced Micro Devices, Inc.; 31.0.14057.5006) - AMD Ryzen 7 5700X 8-Core Processor (16 Threads)
Issue description
What's intended is to use a dictionary of preloaded scenes as a source to load up in-game menus from, like below:
This is stored inside of the "MenuManager" scene's only script, and is made globally accessible by having a
global.gd
autoload declare the following:...and then have the MenuManager scene assign itself in its
_enter_tree()
function:As early as 4.3 snapshot 4, trying to access this dictionary from a scene that is itself preloaded in said dictionary, such as with the line
var inst: Control = Global.menu_manager.scenes['ExampleMenuTwo'].instantiate()
, this starts causing theParser Error: Could not resolve member "scenes".
error which prevents the game from running. If, in this case,ExampleMenu
is removed from the definition ofscenes
, then everything works as normal.Steps to reproduce
Create two scenes to test with, and in another scene / script, define a dictionary including both of them.
Have a script within
example_menu.tscn
- attached to any node within the scene - that tries to access this dictionary.This will cause the parser error.
Minimal reproduction project (MRP)
4.3d5-dictionary-bug.zip
Production edit: added gdscript highlighting
The text was updated successfully, but these errors were encountered: