I’m currently making a game on Android, and I discovered a small bug that’s probably already known but for which I can’t find any solution.
The problem does not appear on Windows or in the Unity editor but in Android mobile.
I created a button on a Canvas, and it called a simple function allowing you to change a text “A” to “B”.
No complicated code, just a simple text.mynewtext changed in a public function assigned directly to the button via the editor.
The problem is that if I click on this button for the first time after launching the application on mobile, whatever the waiting time between the moment when the application is launched and when I press the button. There is a small latency between touch and text change of 0.2-0.3s.
I then created a reset after 5 seconds to test, and if I press the button again once the reset has passed, then the text changes instantly.
I don’t know where it could come from, if it’s on the script side, or if it’s a problem with the detection of the first press of the button?
If anyone can explain to me where this comes from and how I can get around this problem I would be very grateful!
Ps: I didn’t show any code or screenshot because I don’t use any particular method or way of doing things, just 1 line of code, a Textmesh pro, and a button
Have a nice day!