godotengine / godot-docs

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

ScreenTouchInput.index provides bad or misleading information #4431

Open pigigi opened 3 years ago

pigigi commented 3 years ago

Your Godot version: 3.2.1

Issue description: The documentation for ScreenTouchInput.index mentions "One index = one finger", which can be interpreted as index containing the index of the touch, such as 0, 1, etc., which isn't the case. Instead, it seems to be a unique number that increments for each event. The value starts rather high and does not map to touch index.

URL to the documentation page: https://docs.godotengine.org/en/stable/classes/class_inputeventscreentouch.html

madmiraal commented 2 years ago

This is platform dependent. On Windows and Linux, the index is incremented with each touch. On Android, iphone (iOS) and javascript (HTML5), the index is reset to zero once every touch has ended i.e. it's always zero unless there is a multi-touch event, in which case the second simultaneous touch gets index 1, etc.