Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | wooshuwu |
I am trying to connect a signal to a method and I have successfully been able to connect the signal to the function, but when I try to print the parameter value it says it’s basically the zero value of whatever data type I tried.
Here’s what I tried:
startButton.Connect("pressed", startButton, nameof(this.startMenuPressed), new Godot.Collections.Array(){"start"});
and the function is as follows:
public void startMenuPressed(String buttonName){
GD.Print($"name: {buttonName} name equal: {buttonName == "start"}");
I also tested buttonName == “” and it printed out to be true. How can I pass the string value to the function? I also tried instead of the “start” directly, having a String variable that was equal to “start” instead, same results.