Passing argument to method from signal in C# - setting from editor

Godot Version

4.3

I have two buttons that I want to connect to the same method, and pass information to indicate which button is calling.

public partial class Main : Control
{
	private void DoThisOrThat(string whatToDo){
		GD.Print("Should do " + whatToDo);
	}
}

Using the editor’s signal connector, I’m adding a string argument:

I’m getting this error:

Cannot connect to ‘pressed’: the provided callable is not valid: Control(Main.cs)::DoThisOrThat

Am I doing somerhing wrong or is this an engine limitation?

I did the same and the first time I tried it - I got the same error as you. But then every consecutive time I tried it - it worked without any issue.
I can’t explain it… seems like the engine bug.
Maybe you can just try again a couple times?

I did with the same results each time.

Try with public method?

2 Likes

Damn, it’s the small things that’ll get you. Thanks!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.