Any tips on learning GDScript?

Godot Version

4.7

Question

So I am having trouble doing GDScript. I do need some help. I haven’t learned any other coding language like Python so GDScript is my first one. Please give me some tips. Thanks!

This is a good starting point.

I did that but I somehow screwed up and it broke

Then you should try and fix it, that’s part of learning.

If you’re learning your first programming language, it can help to start with very small toy programs and work your way up. There’s a reason most languages have a “Hello World!” example that just prints that and quits.

You’re trying to build up an intuition for how the system works, and it’s easier to do that when you are looking at simple examples that you can reason through and tinker with. As you get more comfortable with the basics, you can start expanding outwards.

I’d say for a start, maybe make a program that’s just a button that prints your name to the console if you press it. When you have that working and understand it, add a text input box, and make it so that when you press the button, it prints whatever is in the text box to the console. Maybe then tackle a calculator or an RPG dice roller (d4 button, d6 button… d% button…).

Alternately, maybe start out with an unmoving sprite in the middle of the screen, and when you have that working, start looking at moving it with the cursor keys or the gamepad.

Once you have a sense of the basics, you can start tackling understanding new parts, and if you keep at it, you’ll know enough to build however arbitrarily complex a game you want. There’s a community here to help if you get stuck.