godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.72k stars 3.05k forks source link

2D Movement tutorial - doesn't talk about movement #4488

Open CitrusWire opened 3 years ago

CitrusWire commented 3 years ago

https://docs.godotengine.org/en/stable/tutorials/2d/2d_movement.html

On that entire tutorial there isn't a single line that actually talks about the actual movement methods or how to make stuff move!

The closest it gets is: "We'll use KinematicBody2D for these examples", but that seems to defeat part of the point of the tutorial as move_and_slide is documented in there, with no mention of it or what it does whatsoever in the "movement" tutorial.

The tutorial does do a good job of covering the input handling components.


Also the code examples would benefit from comments - https://github.com/godotengine/godot-docs/issues/4188 - For example, why velocity is declared as a script global but then redeclared to equal the exact same thing at the start of the get_input method? I assume it's to reset it to 0, but that's non-obvious, even to me as an experienced (non-godot) coder, especially as the examples all assign the output of move_and_slide to velocity.

3dinvein commented 3 years ago

if you only want 2D motion, please try this:

func _process (delta): your_sprite.position.x 5 delta pass (optional)

this is the simplest way to move anything on the Godot Engine. But this way applied only for 2D ok!

CitrusWire commented 3 years ago

Thanks. I came across this tutorial which covers all(?) the ways you can move things in Godot. That is a movement tutorial.

https://godotlearn.com/godot-3-1-how-to-move-objects/

Edit: Forgot to include the link!