|Topic was automatically imported from the old Question2Answer platform.
After about a year of learning, I’m getting pretty good at GDScript, but lately this thing keeps happening where I’ve created a .gd script for a scene, and I’m editing the code, and suddenly there’s two versions of it in the script file list - the second one ending in “tscn::1” - like for example I’ll have
Typically, once it’s created, that will be the script the scene follows - so edits made to the original
MiniBoss_one.gd file won’t apply.
Any thoughts on what’s causing this, and how to prevent it from happening, or how to fix it once it DOES happen?
Appreciate y’all, as always.
Sounds like maybe you’ve ticked the Built-in Script checkbox when creating a new script (from the Attach Node Script dialog)? Doing so will cause the associated script to be stored in the scene file rather than as a separate
.gd script file. You can save the internal script as an external file by:
- Select the node containing the script
- In the inspector, hit the down-arrow beside the
- Click the
Here are a few other hits on this topic that might contain useful suggestions:
Thank you for this response! But I actually don’t have the “Built-in Script” checkbox ticked? And the other links are helpful but still don’t seem to answer why it’s happening?
But it’s ok - the ghost script seems to go away when I close out of Godot and re-open it, folding any new code into the original .gd script, so as long as I don’t accidentally make code changes in that one I’ll be fine.
samjmiller | 2022-11-22 21:26