Open dploeger opened 3 years ago
This might be a general problem with Resources not strictly a bug, see https://github.com/godotengine/godot-proposals/issues/18 There's a PR that likely solves this issue #41264
I'll try to test your sample project with my PR's build to see if the issue is fixed by it. If not, I'll work on adding the fix to the PR's changes.
Thanks a lot!
I am still having this issue using the latest 4.0 beta.
It actually worked after restarting Godot. I think maybe it wasn't going inside this if: https://github.com/godotengine/godot/blob/eaf306e0b15e4283883f06bf903b05711a4dbfe8/editor/editor_resource_picker.cpp#L139
I faced this issue when using Godot 4.2.1 mono build. Tried restarting the engine as per @isaaccp recommendation, but it didn't help :(
Still experiencing this issue fairly commonly in 4.2.1. Sometimes a restart of the editor helps, but not always. When I try to change the values of a custom resource that has custom resources as export vars, it complains that I'm trying to put a "Resource" where a "
I can get around this by changing my custom resource's @export var from a type of Array[<custom resource class>]
to Array[Resource]
, updating the array value for the custom resource I want to edit to have the new custom resource in the array, then changing the type of the @export var back. A little dirty, and I don't like scrolling past every new resource option just to get to Load lol.
Inspecting the resources throwing the error in VS Code, I noticed they didn't have the script_class="<custom resource name>"
of the resource class they extend, but adding that in did not solve the issue (also tried clearing my .godot
directory)
@sambskn Have you tried marking that custom resource as a named script? I think using C#'s Global Class worked for me.
I'm also faced with this issue, the typing is clearly correct but refuses to take it. Very frustrating!
@sambskn Have you tried marking that custom resource as a named script? I think using C#'s Global Class worked for me.
Not sure I follow what you're saying. Is this an edit I can make on the file itself? It's gdscript not C# FWIW
I faced this issue only when I try to load resources from Inspector menu (quick load shows no results, load produces the error message described above). If I drag & drop the same resource from the FileSystem, it works as expected.
v4.2.2, Windows 10
This should've been fixed already. Does anyone have up-to-date minimal reproduction project?
Took me a while to get the right data, but here it is: resource_test.zip
To make it easier to understand I used a realistic example. Practically, we have Card and CardPile classes (card pile contains 1 card, but same issue happens with arrays).
Then we have 4 classes that extend Card and a resource for each of those. 3 resources have a corresponding Card child class as its RefCounted script (card_1, card_2 and nested_card_2), 1 was left with the base Card.gd on purpose (nested_card_1).
We also have 2 resources for CardPile (no child classes were made for those, but I don't think it's relevant).
Case1 - Quick Load:
Result:
Case2 - Load:
Result:
Case3 - Drag & drop:
Result:
Hope this makes sense.
Godot version: 3.2.3
OS/device including version:
Issue description: When referencing custom resource types in other custom resource types and loading a resource file that was previously created based on that resource type the following error is displayed:
The resource can be used, though.
Steps to reproduce:
Minimal reproduction project: CustomResourceTest.zip
In this project: Open the file "parent_test.tres" in the inspector and select the file "child_test.tres" for the parameter "child" to see the error.