Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
arwe2793

mobile multitouch problem

Question

hey :) so i am working on dual touch analogs, and they working, i am able to use left and right analogs, if i touch left side of screen, left analog is activated and etc, but if one of analogs is allready activated, i cant activate another... anyway i hawe few lines

Please login or register to see this code.

the idea is like this > 

 

if (leftone = activated){

            trackf fingerID postion

}

else if (rightone = activated){

          track another finherID finger position

}

how to make code that i could activate both of them with diferent fingers and they both could do stuff in smae time

 

like fingerid stuff, just cant make it work that if left one would be activated first, then right one could be allso activated fith other finger...

Edited by arwe2793

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I beleive Unity stores multiple input touches in an array that each return a position in screen space. Then you can loop the array for each touch, and if the position of the specific touch is within an area, you can then activate. I cant write any code atm cos Im on my phone.

Share this post


Link to post
Share on other sites
  • 0

Here is what I mean

Please login or register to see this code.

Input.touchCount;

for (int i = 0; i <= count; i

++) {

Touch touch = Input.GetTouch(i)

;

}

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

ok first, thank you for hellp :) and second that i put this code inside my script but how tu declare right touch?

 

 

touchPosition = Input.GetTouch (i).position;  ? cuz this one not working, i not realy udnerstand the current srcipt u provided :d

 

if i use i as id of finger i can control first analog with first finger, but if i put second finger,  then i control analog with second finger but not first one :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×