The selected resource (Resource) does not match any type expected for this property

Godot Version

Godot v4.2.1.stable

Question

I’m trying to create custom skills using resources and have an Array[BaseSkill] in a unit, so that I’m able to assign skills in the editor menu.

I have following scripts:

Unit.gd

extends Resource

class_name Unit

@export var skills: Array[BaseSkill]

BaseSkill.gd

extends Resource

class_name BaseSkill

@export var skill_name: String = "SkillNameTemplate"
@export var cooldown: int = 3
@export var texture: CompressedTexture2D = null

func apply():
	print('base apply')

Radiance.gd

extends BaseSkill

func apply():
	print('advanced apply')

Radiance.tres which has RefCounted script attached: Radiance.gd

I get an error when I try to select it in unit’s skills array: “The selected resource (Resource) does not match any type expected for this property (BaseSkill).” unless the attached script is BaseSkill, but I thought I can use a class which derives from BaseSkill - as it allows for custom functionality very easily. It works if I assign the skill by having attached script be BaseSkill.gd and then change it to Radiance.gd, but it either looks like a bug or I’m missing something. If I change it to anything else it shows an error:
“Failed to set a resource of the type ‘Resource’ because this EditorResourcePicker only accepts ‘BaseSkill’ and its derivatives.” – which further suggests that this should be possible, I think.

Would appreciate some help greatly. If there’s anything I can improve in the message or something is unclear - please notify me :slight_smile: