godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

Script Templates should state that each template must be in their own subdirectory

Open rainlizard opened this issue 2 years ago • 2 comments

Your Godot version: v4.0.rc4.official [e0de3573f]

Issue description: Script Templates don't work unless they're in their own subdirectories such as /script_templates/node/, the documentation doesn't make any mention of this.

I also still have no idea at all how to create a Shader Template.

URL to the documentation page (if already existing): https://docs.godotengine.org/en/stable/tutorials/scripting/creating_script_templates.html

rainlizard avatar Feb 24 '23 18:02 rainlizard

Does the subdirectory need to match the snake_case name of the class that is being extended?

Calinou avatar Feb 24 '23 23:02 Calinou

Here's my testing, attaching a script to a TextureRect and seeing what templates are detected in the project's local /script_templates/ directory: /script_templates/texturerect/ : detects the template /script_templates/TextureRect/ : detects the template (I'm on Windows, don't know if Linux treats this differently) /script_templates/texture_rect/ : does not detect the template

Project Settings -> 'Node name casing' has zero effect on this, nor does renaming the node. (just checking)

and of course, any templates in /script_templates/node/ are also detected for TextureRect as well, because TextureRect inherits Node.

rainlizard avatar Feb 25 '23 07:02 rainlizard