Error connecting button nodes
Asked Answered
E

2

0


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!

Edwinaedwine answered 10/1, 2023 at 1:26 Comment(0)
T
0

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).

Triaxial answered 10/1, 2023 at 3:11 Comment(0)
E
0

Triaxial Wow thank you so much that's all it took!

Edwinaedwine answered 10/1, 2023 at 21:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.