-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Touch events not working on Godot 4.2+ on Android 14 after PR #80644 #88621
Comments
@devantti created an MRP in version 4.3-dev3, I couldn't reproduce the problem. Your MRP weighs more than 150MB, I recommend that you create an actual MRP that reproduces the problem, as the problem is possibly not in the "_input", it could be a UI element that is obstructing something, or another problem, please provide an Minimal reproduction project. |
Updated MRP to original message, removed android folder. |
Screen recording from emulator: Screen.Recording.2024-02-21.at.13.28.02.mov |
Any ideas how to fix this? Booted up finally my Windows machine too. Installed all the stuff. Tested both MRP and created also a fresh project. And alas still no luck with touch events on mobile. Godot v4.2.1.stable - Windows 10.0.19045 - GLES3 (Compatibility) - AMD Radeon RX 6800 XT (Advanced Micro Devices, Inc.; 31.0.23013.1023) - AMD Ryzen 5 5600X 6-Core Processor (12 Threads) Does it matter what SDK version I have installed. First installed just what came with Android Studio and then by following the instructions at https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_android.html: |
I've tested _input and _unhandled_input in both 4.2.1 and 4.3 dev4. Exported APK tested on device Google Pixel with android 13. InputEventScreenTouch doesn't work for me either. |
Tested with new versions of Godot. Touch works on 4.1.4 but not on 4.2.2 or 4.3 dev 5. |
I have tested the MRP on Debian Linux and exported it to an Android 13 device with the following Godot versions
I was unable to replicate the behavior indicated in the screen recording above. For me dragging on the Android device has the effect, that "Drag" and "Touch" Labels are created. @grumpOldman from what Operating System did you export the MRP? I would like to find out, why I can't replicate this problem. |
Could Android studio version and other Android libraries affect if it works or not? |
@Devantii using exactly your code in v4.2.2.stable.official [15073af]: extends Node2D
@onready var label = $Label
func _input(event: InputEvent):
label.text = event.as_text()
if event is InputEventScreenTouch:
var touch_position = event.position
var label_node = Label.new()
label_node.text = "Touch"
label_node.position = touch_position
add_child(label_node)
elif event is InputEventScreenDrag:
var touch_position = event.position
var label_node = Label.new()
label_node.text = "Drag"
label_node.position = touch_position
add_child(label_node) Running on Samsung M31 device works fine: video4999357226922542972-1.mp4 |
@brcontainer what operating system do you use? |
@Sauermann I'm using Windows 10 to generate the APK. But keep in mind that I'm not building locally, I'm generating the APK from the export template (mirror: I suspect that the OP's problem is some UI element in his game, or that he is testing on the emulator and maybe there is some configuration in the emulator that is conflicting. Note: I also tried using
|
I installed Android Studio, tested it using the emulator, and was able to reproduce the error. To be more direct, it seems that the error only occurs in the emulator (QEMU: https://developer.android.com/studio/run/emulator). Edited: I can also confirm that v4.1.4.stable.official ([fe0e8e5]) does not have this error in the emulator, work fine, see: |
I can confirm the bug on Linux when exporting the project to an emulator. @devantti You have mentioned, that you experience this bug also on a physical device. Can you please verify this and tell, on which physical device you experience this bug? Otherwise it looks like this affects only emulators. |
@Sauermann: Exported my project to Android on Godot v4.2.2.stable.official [15073af] with both use gradle build set on and off. Tested on Samsung Galaxy S23 (SM-S911B/DS) with Android version 14 and it didn't work. I did also double check and exported Godot v4.1.4.stable.official [fe0e8e5] and it works on same device. |
I have investigated the difference of behavior, when running the MRP on the emulator and on a Sony Android 13 device. The behavior differs for this code section: godot/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java Lines 447 to 453 in 6118592
Looking at https://developer.android.com/reference/android/view/InputDevice we get the following difference between the input events sent from the emulator/device:
So it looks like the comment #80644 (comment) was justified and the change of that PR introduced this issue. Without a Pen, I can't properly test, if changes to the above function will break godotengine/godot-proposals#735 |
Sounds like we may have a difference in behavior between Android 13 and 14 in this API? |
I have tested the MRP on an emulator with both an Android 13 and an Android 14 image. To me it looks like a behavior of the emulator that adds |
Apologies, I can't remember the exact circumstances around the removal of that line, but I remember it was affecting stylus events in some way. |
It was built/exported on Windows 10 |
I can confirm,I have the same problem with Samsung S24, Windows 10, Godot 4.2.2. |
I can replicate the issue on my Pixel 7 Pro running Android 13. However, my Pixel 6A running Android 14 running Android 14 is unaffected. Touch events are sent as expected. |
I can confirm with my FireHD 8 (2020) and Godot 4.2.2. I just use the Godot Editor on Android and doesn't have export my project yet but with Godot 4.2.2 the touch events doesn't work, with Godot 4.1.4 it works. |
Tested versions
Reproducible in: 4.3 dev3, 4.2.1 stable
Not reproducible in 4.1.3
System information
Godot v4.1.3.stable - macOS 14.3.1 - Vulkan (Compatibility) - Apple M3 Pro - Apple M3 Pro (12 Threads)
(Have been tested on older Mac with Intel silicon)
Issue description
I am creating a small mobile game. I am using https://github.com/Federico-Ciuffardi/GodotTouchInputManager. I updated Godot from 4.1.3 to version 4.2.1 and touch events stopped working. First I thought that problem was in that asset but then I tested godot native events and they didn't work either.
In included demo project it detects for example touch and drag in 4.1.3 but in 4.2.1 it only detects left mouse button and mouse motion. I have tested it in both emulator and on physical device.
I went through change log and didn't noticed any breaking changes that should affect this.
Steps to reproduce
I created a clean project and added one small script
Minimal reproduction project (MRP)
Whole project can be downloaded from: https://drive.google.com/file/d/1-2dK2HoJXY93pOmdzj7exX7wlihuFy_y/view?usp=sharing
The text was updated successfully, but these errors were encountered: