Your button is a block that doesn't know what to do. Here's how you give it its first set of instructions.
Not started yet.
Students will attach a C# script named Main.cs to the Main node, print a message from the starting-up method, build the project, read the message in the Output panel, and then change the label's text from code.
A script is a set of written instructions attached to a node. Godot calls the starting-up method once when the node enters the scene, so anything inside it runs one time when the game begins.
The class name in the file has to match the file name exactly, so Main.cs holds a class named Main. The word partial has to be there too, and Godot's template already includes both.
After changing any C# the project must be built, using the hammer button in the top right or Alt+B. Without a build, Godot keeps running the old code.
Leaving the language on GDScript, which is the default in the Attach Script window. The file then ends in .gd instead of .cs, and none of the C# lines will work.
Forgetting to build after typing. The game runs, nothing changed, and it looks like the code is wrong when it just hasn't been built.
Missing a semicolon at the end of a line, which shows a red underline and an error in the bottom panel. Every line that does something ends in one.
When this lesson is done, the Clicker project should have a file called Main.cs in the FileSystem, attached to the Main node, which shows a small script icon next to its name.
Pressing F5 should show the message Hello from my first script! in the Output panel at the bottom, and the label should read 0 once it's been changed back.
A parent can open Main.cs and compare it to the code in the last Watch It Worked, where the file has the print line and the label line inside the starting-up method.
Optional. Watch one first, then press Add to put it in the Visual Panel for a student.
Read-aloud is not available in this browser. Try Chrome or Safari.
Before You Start
The words this lesson uses. Tap a card to see what it means, then come back to them whenever a question uses one.
Part One
Questions about the story you just read. Pick your answer straight off, or press Find it in the story if you would rather hunt for the sentence first.
Part Two
The word cards are at the top of this page. Look back at them as often as you need, then answer.