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 POJ · Dec 24, 2012 at 04:39 PM · iospositiontouchipad

iOS -Touch position unchanged, deltaPosition reported

I am experiencing a problem with the positioning of multi touches. In two consecutive calls to Update, the actual position on both axis remained the same for a particular touch, however a non-zero value was reported in the deltaPosition for that axis. Am I attempting to read deltaPositions for touch phases that don't support them perhaps?

My code and debug follows:

Code

 void Update (){
     foreach (Touch touch in Input.touches) {
 
         if (touch.phase == TouchPhase.Stationary){
             continue;
         }
 
         if (touch.phase != TouchPhase.Began){
             float previousX = touch.position.x - touch.deltaPosition.x;
             float previousY = touch.position.y - touch.deltaPosition.y;
 
             Debug.Log("Touch No:" + touch.fingerId);
             Debug.Log("Touch PosX:" + touch.position.x + " - Delta PosX:" + touch.deltaPosition.x + " = " + previousX + " ||| Touch PosY:" + touch.position.y + " - Delta PosY:" + touch.deltaPosition.y + " = " + previousY);
         }
     }
 }

Below is the debug that is output from the above code.

Touch No:0

Touch PosX:1272 - Delta PosX:12 = 1260 ||| Touch PosY:227 - Delta PosY:30 = 197

Touch No:1

Touch PosX:1264 - Delta PosX:19 = 1245 ||| Touch PosY:365 - Delta PosY:-99 = 464

Touch No:0

Touch PosX:1267 - Delta PosX:-5 = 1272 ||| Touch PosY:291 - Delta PosY:64.00003 = 227

Touch No:1

Touch PosX:1264 - Delta PosX:2 = 1262 ||| Touch PosY:365 - Delta PosY:-5.000061 = 370

Comment
Add comment · Show 2
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 Graham-Dunnett ♦♦ · Dec 24, 2012 at 05:28 PM 0
Share

Read up on how capacitive touch screens work. You can expect $$anonymous$$or changes in reported touch positions.

avatar image POJ · Dec 24, 2012 at 11:24 PM 0
Share

Thanks. I was using the delta position to send '$$anonymous$$ouseUp' events to the object the touch was previously over. I am now storing these previously touched objects in an array so I don't need to rely on the delta position.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by asianfanfics68 · May 02, 2019 at 10:17 AM

Oh, great, your article gives me useful information and a fresh perspective on the subject.

temple run

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

9 People are following this question.

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

Related Questions

Unity Remote 3 and accessing multiple Input.touches? 3 Answers

Tracking Touch Points on Screen for Mobile Devices 1 Answer

Rotate camera with iOS touch 1 Answer

How to centre a 3D pinch zoom 1 Answer

Tap to Move Drag to Look Null Reference 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