Open deonix37 opened 3 months ago
Unless I didn't misunderstand what you are doing, this is normal. What the variable expects to drag there is a .tres file that contains the data of a card and you are dragging the script that defines the resource. You can create such a file with the create new resource button in your inspector and selecting the Card or RandomCard resource.
Unless I didn't misunderstand what you are doing, this is normal. What the variable expects to drag there is a .tres file that contains the data of a card and you are dragging the script that defines the resource. You can create such a file with the create new resource button in your inspector and selecting the Card or RandomCard resource.
You are right, I just figured out what I wanted to do is @export var card: GDScript
, and it works fine. But looks like there's just another bug related to exporting custom resources
This is as expected, a script isn't the class it defines, you need to create a resource file instead, as explained above, unsure how this can be documented further though
Tested versions
4.2.2.stable
System information
Godot v4.2.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3050 Ti Laptop GPU (NVIDIA; 31.0.15.5123) - 11th Gen Intel(R) Core(TM) i5-11300H @ 3.10GHz (8 Threads)
Issue description
I have (card.gd):
And (random_card.gd)
If i do this, then I can drag & drop the random_card.gd script that extends Card into the export field, but it doesn't really work, it gives the error: "Failed to set a resource of the type 'GDScript' because this EditorResourcePicker only accepts 'Card' and its derivatives.". Even though it is a subclass:
Steps to reproduce
description
Minimal reproduction project (MRP)
N/A