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 Herman-Tulleken · Nov 03, 2010 at 11:07 AM · touchdeltatime

What exactly is in Touch.deltaTime?

(I came across this issue while looking at possible solutions to my other question: http://answers.unity3d.com/questions/26037/how-do-i-prevent-deal-with-input-lag-on-a-touch-interface).

Does anyone have any information on what the value in Touch.deltaTime is supposed to be? The documentation only says:

Amount of time passed since last change

But I can't figure out how this relates to Time.deltaTime. In my app, I often (but not always) get the touch deltaTimes to be zero while swiping, but non-zero Time.deltaTime. It almost looks like the touches are updated more often than Update is called...if this is the case, is there any way to get touch data in between?

Edit: I get similar results in FixedUpdate - touch.time is usually 0 or 0.012 (fixedDeltaTime = 0.02). Looking at deltaPosition, it looks like the touch data is the same for 4 fixedUpdate frames (I only looked at a sample, so I cannot tell whether it is exactly always 4 frames), which does not really make sense to me.

Another strange thing, while swiping at a moderate speed, deltaPosition.magnitude gets quite big (190). If this is the pixels travelled in 0.08s, then the finger moves at ~2400 pixels per second (which is much faster than I would expect).

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 skovacs1 · Nov 03, 2010 at 06:02 PM 1
Share

Is it not possible that the touch update(change) was called right before Update and therefore the Touch.deltaTime is always 0 in Update? Is it always 0 in FixedUpdate as well? If change is what I interpret the word to mean, then capturing the Touch data more frequently will not really answer your first question though ($$anonymous$$ore on this in your first question).

avatar image Herman-Tulleken · Nov 04, 2010 at 06:07 AM 0
Share

@skovacs1 It could be, I'll do some more tests. I thought I could use the information for more accurate prediction, something like predictedPos = realPos + touch.deltaPosition / touch.deltaTime * Time.deltaTime or some version thereof.

1 Reply

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

Answer by Veehmot · Jul 10, 2013 at 05:50 AM

In fact it is updated more than the update call, jus like a mouse update. From the documentation:

Note that the accelerometer hardware can be polled more than once per frame. To access all accelerometer samples since the last frame, you can read the Input.accelerationEvents property array. This can be useful when reconstructing player motions, feeding acceleration data into a predictor, or implementing other precise motion analysis.

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

No one has followed this question yet.

Related Questions

Touch.deltaTime returning a negative number on Android 0 Answers

Changing the speed variable does not change the speed of the motion of my touch based object. 2 Answers

adjust Sensitifity of joystick.js (mobile) 0 Answers

Make an object move in the direction of touch 0 Answers

Touch returns twice on Android 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