godot: Export variable not shown in inspector when using external script editor
Godot version: 3.2.rc1.mono
OS/device including version: Linux 5.4.12-1-MANJARO
Issue description: I wrote a GDscript, not C#. When I save the exported variables aren’t shown in the inspector. I only can see them after I restart Godot.
Steps to reproduce:
- Open a project with the mono version of Godot and create a scene
- Create a node and a
GDscript
script - Create a second
GDscript
where you put theexport
variable - Inherit the second script in the script attached to the node
- No exported variable is shown in inspector
- Build the project
- Restart Godot and the exported variable is shown
Minimal reproduction project:
Create any Node, add two GDscript / one attached to the node, make an export
variable in the script without a node and inherit the script with the variable in the script attached to the node
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 5
- Comments: 20 (6 by maintainers)
This is an issue I can confirm this on 3.2
Add this line from Visual Studio Code into a script and go back to Godot Editor
export (NodePath) var path2
You will see the script update but the export option does not show up in the UI
Open that script in the built in editor this time and save from the built in editor. All the sudden the export DOES show up.
EDIT: I think the issue is that Script Variables don’t get updated when you change the script externally.
Can confirm this, only soft reloading the script from the built-in editor or reloading the entire project fixes it.
After Debugging the code more, I found the problem. When starting Godot, he is for some reason not parsing the script. The parser returns an error (ERR_PARSE_ERROR). Error is here:
Can't preload resource at path xxx
(Another node). Other scripts work.After saving the script again manually, everything works as now he does not have a parse error for some reason.
Not just external editor, but the internal one as well: https://imgur.com/a/EYgNAeT
What’s odd is that it seems to work and stop working at random. (Godot version for that clip is 3.3.4 win64, using Windows 10)
Hi,
I had this issue, but following the “Your first game” Tutorial I saw the comment below:
I did it and it works. re(Build) project to show the variables in the inspector.