So, I’ve been using Godot for a while now and I think I already understand the basics of how everything works. I love the workflow and except a few things everything is perfect so far.

While working on the game jam (were my brother and I got the second place) I got an idea that I can’t take out of my head. So here is my proposal:

Code in signals

Let’s say we have a Button node and we want to do some simple actions. Most of the example projects included with Godot have some sort of menu that features a few of them.

Signal view

The signal used for interacting with them is usually ‘pressed()’.

More often than not, you will want to do a simple thing with this node, and to do that you have to start cluttering your project.

There is no way to do something quick with that node’s signal, you will have a to create a new file, save it somewhere, name your function, etc… which can start to get messy if you want to do just a simple task.

So, my idea would be to include a way to instead of connecting the signal to a function in a script, make a small code widget for that signal and save it within that node.

That way, if you have a button that you want to close the game, you can simply add this line of code to that node’s signal: ‘get_tree().quit()’

Here is how it “could” look like:

Simple one liner script on a signal

This is, of course, not perfect, and can have a lot of changes, but it would make everything so much faster. Think having this kind of power for every signal!

I would love to discuss this idea with you and keep updating this article if necessary.

Hope you consider it,

Emilio.