You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My Unity project runs in its own activity. My problem is that, it seems when my Unity project is embedded into Flutter, the input detection(drags, clicks, ptrDown, ptrUp events) on Canvas UI lags behind of Native system events by a huge margin.
Concerete example: I move my finger inside a gameobject in a Unity canvas which tracks my finger and prints a dot on screen where my current finger is. Here is an example video showing what I mean, be aware, this is not my app. I made the same app to test if there is a lag and there is a huge lag which is caused by embedding the Unity project. To prove this further, I installed my app directly with Unity to my phone and there was no lag, the dot was printing on my finger location as I dragged it. However, when I embedded my project into flutter and tested it on release mode, the dot was lagging behind by a huge margin. I also enabled developers modes "Show taps" option to see my fingers current location detected by Android system.
For anyone wondering, here is my Unity gameobject code:
// Knob is an rect containing a huge dot as an image
private void Update()
{
if (Input.touchCount < 1)
{
return;
}
var touch = Input.touches[0];
Knob.position = touch.position;
}
My Unity project runs in its own activity. My problem is that, it seems when my Unity project is embedded into Flutter, the input detection(drags, clicks, ptrDown, ptrUp events) on Canvas UI lags behind of Native system events by a huge margin.
Concerete example: I move my finger inside a gameobject in a Unity canvas which tracks my finger and prints a dot on screen where my current finger is. Here is an example video showing what I mean, be aware, this is not my app. I made the same app to test if there is a lag and there is a huge lag which is caused by embedding the Unity project. To prove this further, I installed my app directly with Unity to my phone and there was no lag, the dot was printing on my finger location as I dragged it. However, when I embedded my project into flutter and tested it on release mode, the dot was lagging behind by a huge margin. I also enabled developers modes "Show taps" option to see my fingers current location detected by Android system.
For anyone wondering, here is my Unity gameobject code:
Tested On: Flutter Release Mode
Flutter Unity View Widget Version: ^2.0.0+2
Platform: Android
Flutter Version: 1.22.2
Unity Version: 2019.4.71f
Tested Phone: Samsung Note 10
How may I fix this issue? Input detection is lagging behind by a huge margin when touches on Canvas UI are made.
The text was updated successfully, but these errors were encountered: