Topic was automatically imported from the old Question2Answer platform.
Asked By
Sethington
Hey there, so I’ve basically got a scene structure like this: I have a scene called PartyMember which is basically a kinematic body/animated sprite combo. I’d like to have an exported variable of type PartyMember in this scene so that inherited scenes can use it. However, when I create a scene that inherits PartyMember, the option to change the value is missing. Is this a shortcoming of Godot or am I missing something? Thanks.
Use “export var”
Example: export (String) var MemberType
If your scene inherit the script that contains export (String) var MemberType, then yes this scene will have the option to change the value of this property inside the Inspector, too. (Just put the scene as a child node is not the same as extends its parent class, a script is also a class that extends the class of a node)
If you want a scene to be reused, save this scene. Later you can just load it and instance it, the options you exported will also be there.
to the script, now children have the export variables.
Thanks, this worked for me too.
Not sure why the script that extends the other class also has to have a class_name set in order for exported vars to be shown correctly in the interface, but adding a class_name fixed the issue.