godot
godot copied to clipboard
[RC 6]When extending a class into a node's script, and changing the superclass' @export variables, the inspector doesn't update
Godot version
RC 6
System information
Windows 10
Issue description
If you have a node extend a class containing variables with @export
annotations, the inspector doesn't update the node until modifying the main node script, or restarting Godot.
Steps to reproduce
Create a superclass and then make a new scene with a node, extend the superclass in the node's script Example using Node2D as my scene node
Superclass script:
extends Node2D
class_name Superclass
Node in the scene script:
extends TestSuperclass
Then, just add a variable to the superclass with the @export annotation, like this:
extends Node2D
class_name Superclass
@export var test = "test"
You'll notice the inspector won't update to include the new variable.
Modify the Node2D script and add a variable with an @export
annotation.
Ex:
extends TestSuperclass
@export var testing = "This one is visible in the inspector"
And now both variables are visible in the inspector.
Minimal reproduction project
N/A Re-opening the project causes to inspector to update and show everything correctly.
I'm having a problem exporting aswell using C#, but restarting or editing main node script doesn't solve it.
C# exports do not show up in the inspector until after building the project. Add your exports, press the build button, and then they will be available in the inspector.
Reproduced in Godot 4.0.stable.
The issue has a 100% repro rate on my side. I'm happy to produce an MPV project if that helps somebody look into this.
I'm also having experiencing this issue. v4.0.stable.official [92bee43ad]
@SirLich please do create an MRP for the bug if you are able too, Thank you.
Also happening v4.1.2.stable.official [399c9dc39]
The fast workaround is to change the script in any way and save it. It'll be reloaded with the superclass variables. (At least for GDScript)
Seems fixed in 4.2. If you are still experiencing this bug in 4.2 (beta6 or newer), please comment with a minimal project.