flutter-unity-view-widget
flutter-unity-view-widget copied to clipboard
iOS Multiple-Touch issue
Describe the bug If you touch the screen with your right hand while holding down the screen with your left hand, the OnPointerUp event is not called. If you build and install directly from Unity, it works normally, and it only happens when you build with the flutter plugin.
Android works perfectly, but this error only occurs on iOS device.
To Reproduce Just add some script to demo project with the code:
public class TouchTest : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
public virtual void OnPointerDown(PointerEventData data)
{
Debug.Log("OnPointerDown");
}
public virtual void OnPointerUp(PointerEventData data)
{
Debug.Log("OnPointerUp");
}
}
Expected behavior The OnPointerUp event is called.
Unity (please complete the following information):
- OS: [e.g. iOS]
- Version [2020.1.10f1]
Smartphone (please complete the following information):
- Device: [iPhone 12 pro]
- OS: [iOS 14.8.1]
same here
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C51 darwin-x64, locale en-KR)
• Flutter version 2.8.1 at /usr/local/Caskroom/flutter/2.5.1/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (3 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at /Users/kihongpark/Library/Android/sdk
• Platform android-31, build-tools 32.0.0
• ANDROID_HOME = /Users/kihongpark/Library/Android/sdk
• Java binary at: /Applications/Android Studio 2.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio 2.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.1)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.63.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.32.0
[✓] Connected device (1 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.110
and test unity version uses both 2019.4.34f1 and 2020.3.24f1.
same here. but I don't think android working perfectly. in my case, if second tap in android first tap is re-input. so it's not work properly. but I'm not sure is this problem really because of this package or flutter platform views. because flutter platform views have gestureRecognizers property and this property type is OneSequenceGestureRecognizer. so I'm not sure this is the problem. but i suspect it.
Hello,
I don't think that the problem is in OneSequenceGestureRecognizer. Also, I am not sure that the problem is in unity-widget plugin at all. I have tried to create empty UiKitView and put there only 2 button and I was able to reproduce this issue. Looks like it is a flutter problem: https://github.com/flutter/flutter/issues/96640 @sneakstarberry fyi
Regards.
Exactly the same. Looking for a solution...
@guoguoguilai @pmstudios @limdp99 https://github.com/flutter/flutter/issues/96640#issuecomment-1147951815
@guoguoguilai @pmstudios @limdp99 flutter/flutter#96640 (comment)
It succeeded, but not completely. Any UI above the unity widget would not be clicked.
https://zhuanlan.zhihu.com/p/429345027 看的这篇文章,解决了多点触控问题,屏蔽掉flutter侧的手势,用的原生手势
https://zhuanlan.zhihu.com/p/429345027 看的这篇文章,解决了多点触控问题,屏蔽掉flutter侧的手势,用的原生手势
@wanglairo can you share more details on your implementation? Will be super helpful. Thanks!
https://zhuanlan.zhihu.com/p/429345027 看的这篇文章,解决了多点触控问题,屏蔽掉flutter侧的手势,用的原生手势
I'm looking to use your solution too. Do you have more explanation ? Maybe in english. Thanks a lot