I’m having a bug with the Begin Drag and End Drag event triggers on iOS that isn’t happening on Android, and I’ve failed to find a answer for it. I’m using Unity 2020.3.3.
My screen is split into 2 portions, the bottom portion is a menu with a scroll rect containing a list of UI objects that you can scroll through, and the top is just a normal screen where you can drag and interact with an object (drag to rotate, tap to do something, etc).
The Scroll rect has a raycast blocker than prevents the touch raycasts from through through it and interacting with the object behind it. The scroll rect is only enabled when you tap on certain places on the object, which opens the menu.
The reason why I put the Begin and End drag events on the menu portion is because I don’t want the interaction to immediately switch over to interacting with object as soon as the finger moves above the scroll rect. Vise versa, I don’t want the interaction to switch over to the list if the user starts in the normal portion of the screen and moves their touch into the menu.
I’ve added touch events to the scroll rect like this.
Each event is has a method attached that just sets a bool. The bool, if true, disables the ability to interact with the object. The idea is that if I drag in the menu portion of the screen, while the menu is enabled, it would block interaction with the object even if I drag my finger onto the top portion of the screen, and will do so until let go. Begin Drag sets the bool to true, and End Drag sets the bool to false.
This is working exactly as intended on Android. But on iOS it doesn’t. As soon as the menu is enabled, the interaction is blocked for the top portion of the screen until I start and end a drag on the bottom portion of the screen first.
Since there isn’t a unity remote for iOS that I’m aware of, I’m not sure what the cause is. Any help would be appreciated. Or if there is a better way of doing what I’m trying to do.