All signals stopped working in C# - old projects, new projects

Godot Version

Godot 4.2.2

Question

I ran into a bizarre problem today, and even with extensive searching I have not found anything related to this.

So short version - I lost the ability to use any kind of signal through C#. It always shows the error visible in the screenshot above - that the connected method is missing. This happens with literally any signal I’m trying to connect or have connected before, including:

-existing signals in my pong clone that worked just fine yesterday
-new signals in my pong clone I tried setting up today
-new signals that I try emitting in a completely new, unrelated project (pictured above)
-all signals regardless of type (timeout, body entered etc…)
-all signals that have an autogenerated name (pictured above)
-all signals that have a custom name made up by me (changing the name from snake_case to ThisCase)
-both signals where the function has been set to private or public
-all signals regardless of path (child-parent, sibling-sibling, node connected to itself)

I have no idea what is happening here. All of the information I have, you can see in the screenshot above. Also before you ask:

Do the signal-function names match? Yes, I quadruple checked this one. Even if I let Godot autogenerate the names, and I can clearly see that they match exactly, it doesn’t work. You can see it clearly on the screenshot too: the error says that “connected method _on_timer_timeout is not found”, while the code has an _on_timer_timeout method. And yes, I did try switching it from private to public. (and this is in snake_case despite working with C# beacuse that is the autogenerated name, I did try changing the signal and function names as well).

Do you know what you’re doing? Absolutely not, but this is the fourth project I’ve worked on, and all of my previous projects used signals without a hitch. Also, as I said, my pong clone worked perfectly yesterday, and today does not. Pre-existing script that threw no errors now throws the same “connected method not found” -error.

Did anything change? As far as I know, no. I didn’t update Godot, I didn’t move any files around, nothing. I started working on a new signal in Pong, noticed that it didn’t work, noticed the error, and saw that all of the pre-existing signals suddenly threw the same one.

Signals work fine in GDscript btw.

I’m not even mad really - this is just weird. Has anyone run into anything like this before? I suspect that re-installing Godot might fix the problem, but I wanted to document this anyway and see if there is a fix, for the sake of future me.

Thank you for anyone who takes the time to read this, I know it’s long. I really hope I can fix this without having to start my projects from scratch again!

The first problem I see is that you’re using the same name for your base class as a built-in class. You’re not even using your own namespace. I’m not sure how your naming convention works in other projects… I suggest not using auto-generated names as they break the C# style. If you’re planning to do more programming with it, consider using VS Code or something other than Godot for C#.

Oh this is just an example showing that the signals break even on a completely new project with default names, should have been more clear. I rename everything in my proper projects. And the problem persists regardless of the naming convention.

Did you build project?

Yes, and even exported the project to double check. The project runs, but no functionality tied to signals will work, so timers won’t time out, events triggered via OnBodyEntered won’t happen etc.
Edit: or rather, even if timers time out, the code inside the “on timer timeout” signal won’t execute.

but other c# code works? can you connect signal via code?

Yes, other script works, so paddles in my pong game moved etc.

I ended up taking the easy way out, and saved my projects separately, deleted Godot and reinstalled it and now everything works. This is pretty anticlimatic but I’m just happy I can get back to work.

Still have no idea what caused this but at least it wasn’t permanent. Leaving the post up anyway if anyone runs into the same problem.

1 Like

I’ve had similar problems in the past and I recall needing to dig up where Godot kept my cached, compiled code and manually deleting it, then rebuilding, then it was fine. Maybe not this exact same problem but very similar. I’m trying to remember where that cached file was on disk, I think somewhere in .godot but tbh it’s been a while and I can’t remember now.

Do tell if you remember, might help me or someone else in the future! Thank you.

1 Like

Ok so I poked around a bit and I think the appropriate cache folder is (your project folder)/.godot/mono/temp

and then that will have sub folders for Debug/Release etc. I’m very paranoid about advising anyone to go deleting files without Very Good Reason, but I think it was deleting that whole folder (edit: the /temp subfolder, NOT the .godot folder. DO NOT DELETE THE .godot FOLDER) that did fix up my broken build once weeks ago. And from the name it sounds safe to remove, so it’s probably ok. But always take backups first.

1 Like