Godot Version
v4.2.1.stable.official [b09f793f5]
Question
In my project, I have a Node containing a “level clear” function that I just drop in whatever level can be cleared. All this function does is print a congratulatory message on the screen and loads the next level, so it really does not matter in which way it got triggered and what arguments it received.
So now I’d like to trigger this function using various regular signals from other Nodes placed in the level, for example:
Button: on button down
Area2D / CollisionShape: on body entered
Timer: Timeout
…and so on.
The problem is that some of these signals emit arguments with them too, for example “on body entered” emits “body”, while “timeout” doesn’t emit anything. Or later some signals might send some other arguments too that I haven’t thought of yet.
Is there a way to make this “level clear” function make an exception and ignore the arguments if they are not needed? I have read about it elsewhere on internet but it’s either outdated or incomprehensible to me.