godotengine / godotengine/godot-docs

The interaction between a C# [Tool] script and Resources is not clearly documented

Open
#10,616 0 comments 2 reactions 0 assignees View on GitHub
enhancement topic:dotnet
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:**

4.3

**Issue description:**

In GDScript, a @tool script can reference a non @tool resource object. In C#, as soon as a script is marked [Tool], any Resource derived custom classes it references must be marked [Tool] as well. This is non-trivial, and not clearly documented, as can be seen by the issues opened about it:

https://github.com/godotengine/godot/issues/80021
https://github.com/godotengine/godot/issues/80298
https://github.com/godotengine/godot/issues/85825

There is a pretty nice page discussing the use of [tool scripts in GDScript and C#](https://docs.godotengine.org/en/stable/tutorials/plugins/running_code_in_the_editor.html#important-information). However, due to the phrasing it is not obvious this applies to Resource objects as well.

**Suggestion**

Add a sentence to note that any custom Resource referenced by a C# Tool script must be marked [Tool] as well.

**URL to the documentation page (if already existing):**

https://docs.godotengine.org/en/stable/tutorials/plugins/running_code_in_the_editor.html#important-information

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.