Godot Version
4.7.2.stable.mono
Question
I have a Resource loading some exported data with custom types:
class_name Stats
extends Resource
@export var _enchantment_base: Enchantment = null
In the inspector, when I go to load a .gd file that extends Enchantment, there is nothing. For example:
## in a file: ex_enchantment.gd
extends Enchantment
func get_value() -> float:
return 2.0
…this file doesn’t appear in the load menu.
Essentially what I’m trying to do is get an exported variable with a static type that only allows any .gd file that extends Enchantment. Is that possible or do I have to mess around with @export_custom or something?
Side note: if there is a value assigned to it, it will appear in the inspector when I click on the .tres file, but it won’t be there at runtime (this can happen when you increase the specificity of the static type). This seems like a bug, it should at least warn the user when trying to load the value that it doesn’t fit the static type. I enabled all warnings and it still silently discarded the value despite it appearing in the inspector. (lmk if this bug is already reported since I’m not sure how to word this very well)