- Edited
I'm having difficulty to discover how to convert a code from godot 3 that would be a connection passing the name of the connected button like this:
button.connect("pressed", self, "initiate_build_mode", [button.get_name()])
This is the code that should work in previous versions but now it seems to be like this:
button.connect("pressed", initiate_build_mode)
And it was all fine until I had to use it passing an argument like the name, so when I try this:
button.connect("pressed", initiate_build_mode(i.name))
Godot says it isn't a Callable, but a Nil in argument 2, and connect should only have those 2 arguments. It only works when it passes just the function name like the second example. So how to proceed?
And also it prints the argument passed, the string name, and runs the rest of the code as if it worked but it shows error and close the running scene.