- Home /
iPhone Multitouch Problem
Hello,
I'm having a problem with multitouch. I have a slider on the left and right of the iphone screen in landscape. Using touch I've got both sliding up and down via touch and both respond at the speed I require when moved on their own. The problem starts when I try and move both and the same time. I have disabled one of the handles to test just the other on its own. Moving it with one finger is perfect but as soon as i touch anywhere on screen with a second finger the movement stops working. I wondered if the solution could be found using fingerIds but I'm having trouble understanding them. Any help would be appreciated.
Thanks
You can pull the code from the example set up with the 2 screen joysticks that's included when you import the iphone standard package
Could you perhaps post your code? I've done a few touch-interfaces using Unity with gestures that I could help debug this for you.
Answer by equalsequals · May 23, 2010 at 10:47 PM
What my team and I did when developing a control interface for one of our iPhone games was divide the screen into different regions using Rect.
In our Update loop where we did all of our touch tracking we began with checking if the touch object in question was contained within the Rect and if so handle it appropriately.
We found that this method allowed us to have multiple gestures going on simultaneously with a minimal amount of extra conditional statements everywhere to sort things out.
Hope that helps.
==
Thanks for your input guys. Equalsequals, that worked perfectly. Simply wrapped my existing code with an if statement checked if the touch occurred in a particular region and all is working great now. If you'd like to see the code still then let me know. Thanks
Glad I could help out! Posting code could help others who are having similar problems, just make sure that you mark your question as "[Solved]" when you do. Cheers! ==