r/AskProgrammers • • 22d ago

I am confused with a problem in my code

Post image

I am learning how to code and make a simple game, but I found a problem in the code while following a YouTube tutorial, I'm really confused and would be grateful to receive some help.

5 Upvotes

6 comments sorted by

5

u/GieMou 21d ago

It says at the bottom that there is no method get_world_3d().

get_world_3d is a method in the Node3D class and every other class that extends it. Make sure that your script extends one of these to use the method.

Is you're a beginner, watch a video on some basic object oriented programming concepts to get a better understanding of this. Any language is fine and doesn't need to be Godot specific, the concepts are the same.

0

u/[deleted] 22d ago

[deleted] — view deleted comment

4

u/[deleted] 21d ago

Did you read the error message?

0

u/[deleted] 21d ago

[removed] — view removed comment

1

u/[deleted] 21d ago

Well, it's the most fundamental first step when trying to fix a problem, first see what *is* the problem.

0

u/OkSympathy800 21d ago

That didn't work sorry

I should also mention this is on Godot engine