-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Your first 2D game" > "Cooding the player" has outdated/incorrect information #7085
Comments
I am working on PR for this, for the 3rd point it seems like a know long peding issue. godotengine/godot#18721 |
This was fixed by #6811. The bottom panel is now named MSBuild. Alternatively, as you found out, you can also use the Build button in the top right corner.
This was fixed by #6811.
This is a feature of the Godot code editor, note that the Godot code editor doesn't support C#. It is recommended to use an external IDE such as VSCode, Visual Studio 2022 or JetBrains Rider. Some extensions for those IDEs may attempt to provide a similar functionality.
As mentioned by @MisoMosiSpy, this is a known bug (godotengine/godot#18721). Keep in mind when connecting a signal to a method, the name you specify must match the name used to define the method in your script (this is also case-sensitive).
Methods can be defined anywhere inside your class. If you are new to C# you may be interested in the Microsoft documentation and, even if you are not new to C#, you may also be interested in the C# basics documentation page. |
I was using the documentation to get a better understanding of the Godot environment and how it handles code. Signals are a new thing for me, and I wasn't sure if they were meant to be part of the class, or if Godot would handle them in a different way - I wasn't sure if the Loading the page anew shows my first two points fixed, and due to the third being non-docs related, I'll close this issue. Thank you for your help! |
Your Godot version: 4.0.1.stable.mono.official.cacf49999
Issue description:
This is mainly regarding the C# documentation.
velocity
. We modify components by callingvelocity.x
andvelocity.y
, however, the correct usage isvelocity.X
andvelocity.Y
, without capitalization the build errors.HitEventHandler()
and connecting thebody_entered(body: Node2D)
Signal, the green icon that indicates a connected signal does not appear. A warn does appear, statingMissing connected method '_on_body_entered' for signal 'body_entered' from node 'Player' to node 'Player'.
and refusing to build. The new function is added to the very bottom of the script, outside of the player class, resulting in two errors:player.cs(79,1): Top-level statements must precede namespace and type declarations.
player.cs(79,1): The modifier 'private' is not valid for this item
This can be solved by moving the code inside the player class. The warn does not disappear, however.
Start(Vector2 pos)
, should go. Considering that the previous step places the Signal function outside of the Player class, logic dictates that it should also go outside of it, however, this adds 2 more errors of the same type as seen above. This can also be resolved by placing the code inside the player class.URL to the documentation page: https://docs.godotengine.org/en/4.0/getting_started/first_2d_game/03.coding_the_player.html
The text was updated successfully, but these errors were encountered: