- Home /
Touch with 2 fingers makes conflict with 2 different components.
Hello,
I need to explain a bit more in details since the title doesn't make anything clear.
So I have a puzzle game, where 4 puzzle pieces are arranged one on top of the other (different NGUI depths). please check the picture attached.
I am using NGUI, on the Pieces I have the script "ExampleDragDropItem" attached, on the slots (not visible in the scene, since they are transparent sprites located I have "UIDragDropContainer" attached and EmptyGameObject with "UIDragDropRoot" attached. (All scripts are offered by NGUI and I have'nt created anything for the drag and drop process.
Whenever I Tap on any piece, I change the depth of the sprite so that the current (selected) piece appears on top.
I have disable multitouch from NGUI camera.
However there are cases where I tap with 2 fingers and strange results happened (Puzzle fit in wrong place).
As I display/print touch count, it prints 1 but in some rare cases where each method (raycast vs ngui) recognize different touches (fingers).
In this case, ill be dragging piece 2, but hit.transform returns piece 1 (which will refuse to fit in the accurate slot)
I figured it out that the raycast has recognized finger #1, while NGUI recognizing the other finger, hence the puzzle is sitting in the wrong place.
I tried different solutions, but what solutions do you recommend?
Thanks
Your answer
Follow this Question
Related Questions
Touch dont work 1 Answer
Drag multiple object using multitouch? 1 Answer
How to block dragging if collider hits 1 Answer
Help changing plane.Raycast dragging script 1 Answer
Raycast for touch 2 Answers