Advertisement Jump to content
Sign in to follow this  

Unity Android Touch Event

This topic is 1412 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts



Been really wanting to get into mobile game development, thought this might be a good community to be a part of! I was wondering if someone could help explain something to me. This is in regard to an Android game developed in Java, specifically the input API.


I'm trying to wrap my head around the MotionEvent.ACTION_MOVE events that are passed to the OnTouch method. Everything I've read says that the ACTION_MOVE type events are consolidated into one event. So I've set up an int to save the action, and then another int to save the index. But I'm a little confused here, if move events are consolidated and there are multiple events what index am I getting back when I mask the action and shift the bits to get an index?


Also, is the underlying array persistent between calls to OnTouch? Is it possible to have an ACTION_POINTER_DOWN and ACTION_MOVE within the same array? Or are you getting a fresh array for each motion event?


Any help would be much appreciated!





Share this post

Link to post
Share on other sites

I haven't done any Android development, but it looks like you can just make a test app to see if these things happen and log the results.


I did look at the docks, and I'm reading that the ACTION_DOWN event starts it off, and the ACTION_POINTER_DOWN is for other fingers.

I imagine there could be both an ACTION_POINTER_DOWN  and an ACTION_MOVE at the same time.  It would be difficult to use if the user had to press the screen with both fingers at the same time.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!