Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Capoymaster · Jun 20, 2017 at 10:50 AM · touchtouch controlstouchestouchpadtouching

Touch.Phase Differences ?

I am working in a rather complex touch system and I need some clarifitcation on the documentation provided and some related questions that follows:

Touch.canceled claims to be fired by System after some error on finger tracing like putting ur face in the screen.. But it also claims this is the final part of a touch. Touch.end claims to be itself the final part of a touch.... as well.

I am assuming there is two ways to end a touch, one is the normal behaviour under Touch.end and anotherone when some circustances are met then touch.cancel is fired...... So, when a touch is canceled, is the touch.end code executed? or viceceversa, when a touch is canceled, is the touch end executed?...

when the system triggers the touch state? at the start of the frame? could be a possible exception of switching touch.state during the same frame that could lead to execute different code blocks depending on the state of the touch?

Most code examples and mine now follows the structure of geting the array of touches and getting the touch(0) for track and play with the current touch, but when playing with multitouch.... Documentation says (fingerID is more reliable) because the array wont fit between frames.... so the question is.. is a bad practice to track gettouch(1) when touches are greater than 1? may i lose in some cases the touch tracking if playing with the array?

Could a touch dissapear from track in case of low fps peak?

thank you ! =)

Comment
Add comment
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

2 Replies

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

Answer by NoseKills · Jun 21, 2017 at 02:24 PM

Input gathering is single threaded at least from MonoBehaviours' point of view and it happens between frames so it's not possible for the state to change between the Update() calls of 2 different objects (or during the execution of any method)

End and Cancel events end the touch and simce the state can only chenge between frames, only one of them can occurr for any given touch. E.g. it's not possible to end a single touch in a way that would cause the state to be Cancel in the ending frame and End in the one after it or vice versa.

I don't quite understand the last paragraph :)

I can't remember exactly but i think the cancel state happens fornexample if you put the app to background when a touch is ongoing, lift your finger and bring the app back to foreground.

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
avatar image
0

Answer by Capoymaster · Jun 21, 2017 at 11:33 PM

OK the last paragraph is misunderstanding:::

What i mean to ask is two different things:

1st ------ Playing with multitouch ....... could a different touch share same fingerID ?? ( logic says no but documentation at this says YES "when determined by gestures", My game logic is very sensible and I am using Finger.ID for get track of the multitouch input ,if shared it could cause some touch to run functions not implemented for them ... maybe there is a way to disable gestures??

2nd -... if I undestood you said touch happens between frames and the next frame reads the state....... but again dealing with Multitouch im a bit confused because for example lets say i have 2 touch..... lets name them TOUCH A.... and TOUCH B...... my logic functions are set that wether a touch reaches "end" status ( TOUCH A or TOUCH B ) it looks on the remaining active touches....... for example if TOUCH A ended..... it changes some variables that will use the remainng touch in this case B..... and the question is....... Could I have the situation the 2 touches ended at the same time(frame)....... wich code will execute first if theyr between frames runing?

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

86 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 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 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 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 avatar image avatar image

Related Questions

Merging touches 0 Answers

Rotate with two fingers 0 Answers

Use touch to spawn a prefab 1 Answer

Check whether touch is held 0 Answers

Unusual multitouch behavior (Android) 3 Answers


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