Hello, I am just getting started programming in general and using Godot and am very new. I am still trying to find a starting point to learn but have been tooling around for fun. When connecting a button it creates this line:

private void _on_Start_pressed()
{
// Replace with function body.
}

Which gives errors as shown in the photo. Can someone please help me understand what I need to do to correct this?
I am simply trying to add function to the button.

Thanks!

  • Not 100% sure as I use gdscript rather than C#, but my guess is that the _on_Start_pressed function needs to be inside the Start class definition. I.e. try moving that closing curly bracket in line 20 down to the end of the script (and then probably indent the _on_Start_pressed definition for readability).

Not 100% sure as I use gdscript rather than C#, but my guess is that the _on_Start_pressed function needs to be inside the Start class definition. I.e. try moving that closing curly bracket in line 20 down to the end of the script (and then probably indent the _on_Start_pressed definition for readability).

  • Sabb replied to this.