godotengine / godotengine/godot-docs
Docs on new method to get Input is factually wrong and misleading
- Dominant language
- reStructuredText
- Stars
- 5.7k
- Forks
- 3.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 25
Description
**Your Godot version:** 3.4, 3.3.4
**Issue description:**
https://docs.godotengine.org/en/stable/tutorials/inputs/controllers_gamepads_joysticks.html#which-input-singleton-method-should-i-use
There are so many things that are factually not right here and will lead Godot users and players of their games into worse development and gameplay experience.
> There are 3 ways to get input in an analog-aware way
No there are not just 3. There are many more, with different usecases each (what kind of deadzone you want, how much deadzone you want, if you want deadzone at all ...
> When you have two axes (such as joystick or WASD movement) and want both axes to behave as a single input, use Input.get_vector():
This is really bad advice because it will lead to very inconsistent behaviour. with WASD the user will be able to walk in a straight direction, but when they use analog stick they suddenly can't walk straight any more.
This is because unlike Input.get_action_strength() and Input.get_axis(), Input.get_vector does not have a deadzone along both axis. Input.get_vector() only has a central deadzone.
Most games however will require the player to move straight more often than not. Also intuitively, the Player will "just want to go forward", not drift left or right when they hold their analog stick straight forward.
Take as an example countless 3D thrid person games that ask you to walk over a beam or narrow bridge. If the Godot user develops their game with Input.get_vector(), these passages will be incredibly frustrating. And overall the controlls will feel less tight because they can't "just move left" or "just move right" anymore without also driving slightly somewhere else.
In stealth games when you would try to gradually and slowly accelerate your character, it becomes impossible to do so in a straight direct using Input.get_vector().
There are countless more examples, which is why most games use an axis deadzone besides the central deadzone.
Godot now allows you to now more easily disable the axis deadzones, which was already possible, but is now more convenient. That's great! However only having the central radial deadzone by no mean ideal for most games or usecases. The opposite is the case!
The current Documentation is for some reason dismissive of the of way to get analog Input, without mentioning how Input.get_axis() can is now a much shorter, much more convenient way to get the same result:
`var velocity = Vector2(Input.get_axis("left", "right"), Input.get_axis("up", "down"))
`
This is the same as
```
var velocity = Vector2(Input.get_action_strength("move_right") - Input.get_action_strength("move_left"),
Input.get_action_strength("move_back") - Input.get_action_strength("move_forward"))
```
This means you also get the axis deadzones with this approach.
Input.get_vector() should have a warning that you will get driving issues and it should only be used in cases when the player would not **_ever_** want to get a straight Input direction. (honestly I have a hard time to even think of practical usecase examples).
> This handles deadzone in a correct way for most use cases.
> The line below is similar to `get_vector()`, except that it handles
> the deadzone in a less optimal way.
These statements are definitively and factually wrong and very misleading. I can already see countless people confused and frustrated in the community channels why their character won't move straight. People who do community support will have to answer the same thing again and again. Let's please fix this as soon as possible.
**URL to the documentation page:**
https://docs.godotengine.org/en/stable/tutorials/inputs/controllers_gamepads_joysticks.html#which-input-singleton-method-should-i-use
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.