Normal buttons work just fine but for some reason touchscreenbuttons don't work at all when exported. They workk normally when on my computer. I checked - no control nodes blocking the buttons. Any idea how to fix?
I just added a TouchScreenButton to an existing project and tested it with an Android export from Godot 4.3-dev1. It worked correctly.
To test it, I added a child Label to it and attached this script, which increments a displayed count on each button press:
extends TouchScreenButton
func _ready() -> void:
$Label.text = "0"
pressed.connect(func(): $Label.text = str(int($Label.text) + 1))
I generally use normal buttons, which for Android require enabling the project setting input_devices/pointing/emulate_mouse_from_touch, but that's not needed for a TouchScreenButton.
Secularity Can you test it in godot 4.2.1? Because whatever I do they just don't work
tested this on two different projects - both don't work
Narcose Can you test it in godot 4.2.1?
I've deleted the test code. But you can create a minimal project to test it in 4.3-dev1. I doubt if there's been a change in that area.
By "minimal project", I mean a project that contains nothing but the button, label and script.
If it fails in both 4.2.1 and 4.3-dev1, upload the minimal project.
both versions don't work
I downloaded the .zip, imported it into Godot 4.3-dev1, and exported it to Android using one-click install. The TouchScreenButton works.
The only change I made was to disable "Use Gradle Build" in the Project / Export settings. I had to do that so that I can use the standard export templates.
So maybe it is because of gradle? Idk what to do really i have like 100 of theese touchscreenbuttons in my game.
Why can't you use normal buttons?
Secularity I would need to change every touchbutton in the game which would take a lot of time. Could this possibly a bug?
If it's a bug, why does the button work for me?
Did you try disabling "Use Gradle Build"?
Try searching the github issues. I found several by searching for "TouchScreenButton".
Secularity Maybe it only doesnt work when you use gradle. From my understanding i need to use gradle because of my plugins or something.
edit: it also doesn't work without grade. I have know idea what im doing wrong T-T
Secularity ok
Secularity Maybe it is an emulator problem?
Tested two different projects on 2 different versions of godot on 2 different emulators with different settings, nothing works. Slowly loosing my mind 🙂
You're having the problem when using an Android emulator? What about on an actual Android device?
Secularity hehe i dont have one
You should have said that earlier. Can you upload the .apk for that small test project?
Secularity ok, ill try
I installed test2.apk on my Android phone.
Both buttons work. If I touch the left button, "touchscreen button pressed" is displayed. If I touch the right button, "normal button pressed" is displayed.
Secularity huh? So why does it not work for me. Maybe I should install a new version of android studio but I doubt that is the cause. The funny thing is everything worked normally before…
I have Android Studio installed, and have used it for making Android apps using Kotlin and Dart/Flutter.
But I've never used it for emulating a Godot Android app. I'd like to do that, but haven't figured out how. If you can provide instructions on how to do that, I could try it and see if I can duplicate the problem you're having.
Secularity ok
i was testing a litttle bit more and it turns out it doesn't detect any touch input, only mouse.
Please, can anyone help?
Secularity did you try it already? 🙁
The instructions you provided were too vague, and I haven't been motivated to spend the time figuring out the details.
It might not help solve your problem anyway.
© 2022 - 2024 — McMap. All rights reserved.