Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Xavier78 · Apr 17, 2014 at 03:23 AM · touchphase

How does TouchPhase really work

So i have 4 questions

1 does touchphase.begin = the first time you touch the screen or each time you re touch the screen.

2 does touchphase.moved = the time from when you started moving to the point you lift your fingures off, or if you fingures are in a new location from thouchphase.begin, or when ever your fingers move, not including pauses.

3 does touchphase.stationary = the time right after touchphase.begin but not waits after touchphase.moved, or all stops while your finger is on the screen.

4 does thouchphase.end = when you lift your fingers off the screen, or there are no fingeres on the screen.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image robertbu · Apr 17, 2014 at 03:27 AM 0
Share

The simplest way to sort this all out is to write a simple app that outputs the TouchPhase to a GUI.Label() or GUIText(). Note you'll want to output the Touch.fingerId associated with each event so that you can track the results as multiple fingers are used.

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Owen-Reynolds · Apr 17, 2014 at 06:26 AM

Yes, test it, since you'll think of other odd stuff and will want to rerun it. But:

Each finger down triggers one begin, for only that frame. If you manage to tap three fingers during the same frame, you get three touches, and all are begin. If you have an existing touch, and tap a second, the new one will be a begin.

Each frame after begin, the touch will be either move or stationary, depending on whether it moved that frame. It doesn't "remember." If you move then stop, it says stationary. If you want to know if the finger has moved ever, you have to remember it yourself.

End, like begin, is for each finger. Moving off the edge is an end. The only way I've seen an abort is slapping your palm on it.

The trick is, each finger has a permanent ID. So, during a touch, maybe it gets ID=2. There will be a single 2-begin, then a bunch of 2-move/stationaries, then a single 2-end. Now, maybe during those same frames, a 3-begin, move, move, move, end will be mixed in. Old ID's are reused. For an iPad, the ID is always the first unused number, starting at 0.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

TouchPhase.Ended does not work if ray is not hitting object. 1 Answer

Swipe horizontally and hold finger down to move character? 1 Answer

Need Clarification on some Touch Struct Variables 1 Answer

Touch queue problem 0 Answers

Touch Phase ended not executing 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges