godot icon indicating copy to clipboard operation
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

Open diamantico21 opened this issue 1 year ago • 2 comments

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.

diamantico21 avatar Feb 28 '23 00:02 diamantico21

I'm having a problem exporting aswell using C#, but restarting or editing main node script doesn't solve it.

GlitchR9506 avatar Feb 28 '23 00:02 GlitchR9506

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.

silenuz avatar Mar 05 '23 16:03 silenuz

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.

SirLich avatar Mar 10 '23 21:03 SirLich

I'm also having experiencing this issue. v4.0.stable.official [92bee43ad]

asthmahound avatar Mar 12 '23 21:03 asthmahound

@SirLich please do create an MRP for the bug if you are able too, Thank you.

FeralBytes avatar Jun 29 '23 22:06 FeralBytes

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)

ProvoK avatar Oct 16 '23 20:10 ProvoK

Seems fixed in 4.2. If you are still experiencing this bug in 4.2 (beta6 or newer), please comment with a minimal project.

KoBeWi avatar Nov 14 '23 22:11 KoBeWi