0 votes

I don't know if there are something like this in the current Godot version, but I think it would help a lot when we open the project and have to search for the scenes.

in Engine by (690 points)

Not sure to understand..... one script can be attached to several scenes...

Using the same name for both script and scene is a good deal, by doing this you avoid a lot of confusion.

I think that's not possible.

1 Answer

0 votes
Best answer

A scene can have no script, and a script can be on multiple scenes. Godot does not have a function to do this, because it's not an enforced rule. You can somehow "link" a script with a scene by embedding it in the scene, which means it won't have a .gd file of its own and will be stored inside the scene itself (which has some drawbacks tho, such as harder versionning, no name given and global search).
If some of your .gd scripts are specific to one of your scenes in your project, a good practice is to give them the same name. This way, you can easily access them by quick-opening the scene by its name (Ctrl+Shift+O). The scene will open and its script will be available by clicking on the root node's script icon.

by (29,042 points)
selected by

I mean open a scene in the Godot editor though the script it is attached to. In projects with a several number of scenes and scripts I guess it would be a great feature. It could save a lot of time of looking for that lost scene in the file explorer.

Maybe it could be done with "Find references in scenes", which would list all scenes where your script is used?

Where is it in the editor?

It's nowhere, I was just suggesting that could be a feature request.

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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.