0 votes

When I am working in GDScript and following a tutorial, the result I get is often different then what I see in the tutorials. I try to make sure the tutorial I'm following is as up-to-date as possible, so the problem isn't that. Even when I'm following the documentation (yes, I switch to the latest/stable version of it) it comes out different. Is there some kind of bug I'm not aware of?

For clarity, I use GDScript. I gave up on trying to use C#.

Godot version 3.4
in Engine by (17 points)

Its very difficult to answer this without knowing more details, how does your project differ?

Make sure to use Godot docs 'stable', since 'latest' is for developers and testers making the new versions of Godot.

That's just it. I don't know. It says "use this code and it will act like it's supposed to", but when I do- CODE 4 CODE- it acts completely different. Like when the player character is supposed to bounce off an enemy and it doesn't even though the code is written like it was supposed to. And yes, I do check for typos.

I used "stable" and the problem still occured.

Yes, I too know what it's like to be baffled as to why my code isn't working like it's supposed to.

One thing I noticed is that if I'm following a tutorial and I miss a step somewhere (or I do a step a little bit wrong), sometimes that throws the code off. So if I'm doing a long tutorial, and if my code isn't working, then I get suspicious that maybe I missed a step in the editor, so I'll retrace the steps.

If I'm following a short code snippet as a tutorial, then sometimes the tutorial doesn't explain how the code snippet is supposed to be used. If you are following a code snippet tutorial then if you share a link to it, and share a bit more about your code, then someone might be able to make a guess about what is wrong.

Finally, if I'm following a long tutorial (like the ones in the docs, or a 30 min video tutorial), then if worst comes to worst I'll just start a fresh project and go through it again to make sure I didn't make any wrong steps. If after doing that it still doesn't work, then I get suspicious about the tutorial itself.

Unfortunately, I gave up on trying to figure it out. I apologize for not being clear enough. I was following the GDQuest 2D Platformer tutorial (expanded course). The player is supposed to bounce off the enemy and the enemy asset is destroyed. Unfortunately, I gave up and I deleted the project. So I can’t share the code. I’m starting to think the engine is the problem.

It's like, I type it like the documentation/tutorial says, but the editor says I have a problem. I then try to add code to get rid of it, but that only creates more problems for me. I feel like just giving up on this engine.

Sorry for not being clear.

3 Answers

+1 vote

You don’t have to follow tutorials and copy them because you won’t learn much with that.

If you want to learn to code in gdsceipt then download some good beginner python book and practice a lot, write simple console applications.

for example: Prime number checker, display of even and odd numbers using a single loop, friend number finder, and so on.

by (224 points)
+1 vote

I don't know what is your problem exactly. But here have some tips:

If you have no idea about programming, maybe you can try CS50x.

If you just can't follow the tutorial in Godot docs, maybe you can try other step by step video tutorials, for example v1, v2. I think both of them is easy follow for beginner. And here are also lots great video tutorials, you can pick and try to learn.

By the way, if you are unfamiliar with Godot, sometimes the problems may occur in your operation, for example maybe you loss some settings of inspector. So you have to make sure all steps is ok, not just have the same codes with tutorials.

Finially, try to use print statement to test your codes and read error message that Godot give you.

by (526 points)

I type it like the documentation/tutorial says and it says I have a problem. I then try to add code to get rid of it, but that only creates more problems for me. I feel like just giving up on this engine. That's what I meant. Sorry for not being clear.

0 votes

Without going into the specifics of what you're referring to, an answer for your question is impossible - beyond just saying that you probably missed something you might not know was important.

The problem probably lies in your script's letter casing
Are you typing it exactly as the tutorial is showing you?
func, for example, is completely different from Func
One is the syntax to start a function, while the other is a variable name. (A poor one)

Gdscript can store and turn basically anything into a var, and the program has absolutely no way of knowing, if you accidently made var with a name similar to something you shouldn't have --- like with Func

by (16 points)

Sorry for taking so long. What I mean is that the script editor shows errors when there aren't supposed to be any. I type it like the documentation/tutorial says and it says I have a problem. I then try to add code to get rid of it, but that only creates more problems for me. I feel like just giving up on this engine.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.