godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.6k stars 21.28k forks source link

InputEventScreenDrag and InputEventScreenTouch event.index are bug values on iOS/iPadOS web export #95941

Open Scriptering opened 3 months ago

Scriptering commented 3 months ago

Tested versions

System information

Godot v4.3.stable - macOS 14.5.0 - GLES3 (Compatibility) - Apple M1 - Apple M1 (8 Threads)

Issue description

On android and on my mac with mouse to touch emulation, event.index displays the expected value of 0 with the first finger, 1 with the second etc. on the web export:

Screenshot 2024-08-22 at 11 10 21

On iOS/iPadOS, an overflow? value is displayed, and each subsequent touch event will increase the counter, regardless of which finger caused the event:

Screenshot 2024-08-22 at 11 08 09

I was unable to load the web export prior to 4.3.stable, due to the no threads update, so was unable to test previous versions.

Steps to reproduce

Create a new project, paste the following code, export to web and test,

func _input(event: InputEvent) -> void:
    if event is InputEventScreenDrag or event is InputEventScreenTouch:
        print("_input: %s"%[event.index])

Minimal reproduction project (MRP)

N/A

RendersJens commented 2 months ago

Same issue, I am finally able to support IOS in my browser game thanks to the no threading web update in godot 4.3, but now this haha. Let me know if there is some workaround.

Also, I see that this has label "platform:macos", but it is not an issue on macos, only on ios (web export).