0 votes

With this in a script:

extends Node
export(Resource) var resource

Clicking on the node brings up the node in the Inspector panel at right. Under Script Variables, "Resource" is displayed along with an box indicating empty and and arrow to access the New Resource menu. This menu is very long and requires scrolling all the way to the bottom to access the Load command for loading a resource file and for copying and pasting resources.

Is there a way to make this more efficient or skip to the bottom of the menu without scrolling all the way with the middle mouse button?

asked Aug 4, 2019 in Engine by goshot (64 points)

1 Answer

+1 vote
Best answer

export(Resource) litterally tells the editor that this variable can contain any type of resource. So it's showing you everything.
I think it was mentionned somewhere on Github that this should be adressed, like showing a proper window with search option instead, but I can't find it right now.

If you are expecting a particular type of resource, you should specify its type. For example, if you expect a Texture, write export(Texture). If you expect a custom resource type... see https://github.com/godotengine/godot/issues/30694

answered Aug 6, 2019 by Zylann (26,131 points)
selected Aug 9, 2019 by goshot

Thanks for answer and link to github issue. For anyone else who reads this, unlike what is reported in the github issue, I do not see my custom resource in the list even with class_name defined in the custom resource script. I can find it when clicking on the icon for creating a new resource in memory right under Inspector in the inspector tab.

Is your custom resource part of an addon?

No, my custom resource is not part of an addon.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.