-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Is there an existing issue for this?
- I have searched the existing issues
Unity version
Unity 6000.0 LTS
Common issues
- I have checked the common issues
Flutter version
3.29.0
Description
❌ Unity Touch Not Working on Android – Render OK but Tap Events Fail
❗️Issue Summary
Unity renders correctly on Android using flutter_embed_unity plugin v1.2.7, but touch/tap input does not work. On iOS, everything functions as expected — including touch events. The issue is Android-specific.
✅ Environment
- Flutter version: [insert your
flutter --versionoutput] - Plugin version:
flutter_embed_unity: 1.2.7 - Unity version: [6000.1.7f1]
- Android version: [e.g., Android 14]
- Device: [e.g., Vivo V25 Pro]
- iOS status: ✅ Working fine (render and touch)
- Android render: ✅ Renders fine
- Android tap: ❌ No response from Unity
🛠 What I’ve Done
-
✅
MainActivityextendsFakeUnityPlayerActivity:class MainActivity : FakeUnityPlayerActivity()
-
✅ Added
gestureRecognizerstoAndroidView:gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{ Factory<OneSequenceGestureRecognizer>(() => EagerGestureRecognizer()), },
-
✅
AndroidManifest.xmlincludes:<meta-data android:name="io.flutter.embedding.android.AndroidViewEmbedding" android:value="hybrid" />
-
✅ Unity input code in scene:
void Update() { if (Input.GetMouseButtonDown(0)) { Debug.Log("TOUCH DETECTED"); } }
-
✅ Tested with both
Input.GetTouch()and UI Button (OnClick) – works in Unity standalone APK -
✅ No overlay widgets in Flutter, using full-size
SizedBox.expand()around Unity view -
✅ Ran
flutter clean && flutter pub get && flutter run
🔍 What Happens
- Unity renders properly in Flutter Android build
- No tap or gesture events are registered by Unity
- No logs from
Debug.Log("TOUCH DETECTED")or buttonOnClick - iOS works perfectly without changes
📌 Expected Behavior
Taps on the Unity view in Android should register touch input like on iOS.
🙏 Request
Please confirm:
- Is this a known issue with the current Android embedding?
- Is there a workaround or fix available for handling tap/touch on Android?
- Can we get an update or patch to address this?
I'm happy to share code samples, logs, or minimal reproduction projects if needed.
Thanks for your awesome work on this plugin!
Minimum reproducible example (MRE)
https://github.com/user-attachments/assets/01887153-4365-4409-b288-aa4a77085d67
https://github.com/user-attachments/assets/787c212a-7e96-4f5e-9f48-412d75472132
What platforms are you seeing the problem on?
Android
Devices
No response
Anything else?
No response