-
-
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
Add a page about gamepad/controller support in Godot #4620
Conversation
This article is missing information about the most important part: What code should people use? It only mentions that the code paths are the same between keyboard input and controller input, but not what those code paths are.
|
b25cbc3
to
2b8e167
Compare
65ababd
to
04514d9
Compare
04514d9
to
65c460d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now. I made a few fixes and tweaks and added C# example code, let me know what you think @Calinou.
by opening a pull request on the linked repository. | ||
|
||
There are many ways to create mappings. One option is to use the mapping wizard | ||
in the `official Joypads demo <https://godotengine.org/asset-library/asset/140>`__. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This is technically not true just yet, but godotengine/godot-demo-projects#575 was merged, so this sentence will be true the next time I make a release of the demos on the Godot Asset Library.
@aaronfranke Changes look good to me 🙂 |
var velocity = Input.get_vector("move_left", "move_right", "move_forward", "move_back") | ||
|
||
# The line above is a shorter form of: | ||
var velocity = Vector2(Input.get_action_strength("move_right") - Input.get_action_strength("move_left"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is false in fact. One of the advantages of the using get_vector over this is the handling of the deadzone.
With this solution the deazone end up square instead of circular.
I'm ok with mentionning that they are similar but it's false to say they are equivalent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR opened: #4651
Cherry-picked for 3.3. |
(cherry picked from commit 53c1af7)
…4651) See #4620 (comment). (cherry picked from commit c6fedd2)
This is a first pass at documenting controller support in Godot. Feel free to suggest additional things to document.
@aaronfranke I know that you worked on getting input actions on multiple directions for 3.2.4, and I remember this being useful to implement proper deadzone calculations for 2D top-down movement. Could you explain this a little? I don't really know how to document it, but it would be good to have the documentation page explain how to handle dead zones properly in this situation.