I was experimenting something with classes. I made 4 empty scripts, each consisting of only one line, in this order:
class_name enemy_collision
class_name enemy_movement
class_name enemy_death
class_name enemy_shooting

After the experiment was over, I deleted these 4 files. Today I continued working on the same project and I see these classes are still registered in the project, for example if I start typing "extends enemy_" the autocomplete is offering me these 4 classes.

I'd like to remove these classes from the project because they're just causing chaos now that the experiment is concluded, but the files with their definitions are nowhere to be found! For example if I use Godot's own "Search in files", the only line in the whole project where "enemy" appears is one completely unrelated line in one other script. I tried everything I can think of (including the obvious restarting of everything), but I can't get rid of these classes. Where are their definitions coming from?

Edit: every time I attempt to add a new node, I get a warning reporting about the missing scripts. In the log file I can see that Godot is looking exactly for the deleted files… but they are not there anymore.

  • Toxe replied to this.

    guduq Your file names seem to have spaces in them. I am not sure if that is supported so you should try renaming those files and use underscores instead.

    Also if you haven't tried yet close the editor and delete your .godot directory.

      No, spaces in names don't have any effect in this case.
      In the end I just reverted to the previous version of the project, not something I was happy to do but it works now.

      17 days later

      Toxe I have the same problem. Deleting the .Godot directory doesn't solve it at all... I just can't get rid of the classes once they are created 🙁 Any other suggestions?

      -Edit-
      Ok thanks Toxe it worked! I was being stupid.
      I found now that my editor is doing the same: looking for those deleted files where I originally declared the class_names.
      How do I tell it to stop looking for them??

      Try closing all files in the script editing dock, close all scenes, then restart the editor. If that doesn't solve the problem, restart the editor again.

      If the problem still exists, check all the .tscn files for references to the deleted files.

        DaveTheCoder I've done all that and I can't open some .tscn files suddenly, the editor claims they have been moved or deleted, even though they haven't been...
        Thanks for the suggestion though...

          Maelfesh I can't open some .tscn files

          Check them for references with a text editor, outside of the Godot editor.

            DaveTheCoder Thanks, that helped. Actually I found you can r-click the scene and "edit dependencies" without opening the scene -But only found it because you suggested it. Thanks!
            One last thing, I'm getting a "Recursion detected, unable to assign resource to property." when trying to assign a prefab file to a resource....
            Any ideas there? It works with all my other resource-prefab pairs....

            -Edit-
            Never mind, I figured out why. Had a reference to the resource in the prefab for some reason....