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
3
Question by dissidently · Mar 12, 2011 at 09:26 AM · iosfpstouchaccuracy

if I lock iPhone fps to 24fps, can I get more accurate touch timings than that?

at 24fps it's 41.66 milliseconds between frames. Can I get more accurate information about the timings of the players tap/touches of the screen than that, or the reports on touch time locked to the fps?

I want to know the EXACT moment in time between touches. Or as exact as the iPhone clock enables whilst running a game.

Consider 24fps an arbitrary frame rate. It could be 30fps, 60fps or any other rate the iPhone funs at. The point of interest is exact measurement of tap times independent of frame rate. Possible how?

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 Fattie · Jan 23, 2016 at 05:10 PM 0
Share

dupe http://answers.unity3d.com/answers/52823/view.html

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Eric5h5 · Mar 12, 2011 at 09:57 AM

The iPhone screen doesn't do 24 fps, it's vsynced always, so you get 60 fps or 30 fps (or 15 I suppose). In any case, as the docs say, "You can retrieve the status of each finger touching the screen during the last frame by accessing the Input.touches property array."

Comment
Add comment · Show 2 · 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 Jessy · Mar 12, 2011 at 03:45 PM 2
Share

You forgot 20 fps. Also, the profiler tells me I can get ~40ms frame times, too, suggesting 25 is possible. ???

avatar image Statement · Mar 16, 2011 at 02:30 PM 0
Share

I believe deltaTime measures in seconds as the rest of the framework does so. So a value of 0.1 delta time means 0.1 seconds since last change.

avatar image
1

Answer by Statement · Mar 16, 2011 at 02:12 PM

This might be a slight far shot since I have absolutely zero experience with iPhone and developing for it.

I just thought I'd mention that if (and only if) there is a thread safe way of polling the touch data, either via Unity3D or via some other library (if that is supported on iPhone), and if (and only if) you can create threads on iPhone, then;

Create a new thread that samples the data at your fixed intervals and produce a message queue with the samples that you can use in Update via a synchronized Queue. This will in theory allow you to sample input at a higher frequency than your game is updating. You'd typically have to dequeue all of the results to get to the data you're after (maybe you want to smooth it over time or maybe you just want to check for rapid, fine granular movements).

See Queue.Synchronized, Threading, and Threading Tutorial.

This will only work if you can create threads and access input directly. Otherwise this answer is moot and offer no value.

Comment
Add comment · Show 3 · 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 dissidently · Mar 16, 2011 at 04:30 PM 0
Share

so the answer is, "for exact measurements of tap ti$$anonymous$$gs use Objective-C?

avatar image Statement · Mar 16, 2011 at 05:43 PM 0
Share

No, not really. The answer is "if unity iPhone support libs and threads, then you can make a new thread and call the lib that can provide such polling". I don't know enough iPhone development to know fully what is supported or not, but in an ideal world you wouldn't have to touch Objective-C for this task. The threading and synchronized queue are all in .net/mono. How to actually sample the values I don't know. If you can get a library that does this, then use that in the thread.

avatar image Statement · Mar 16, 2011 at 05:47 PM 0
Share

Reading the licenses it seems you can be able to do this. http://unity3d.com/unity/licenses.html See plugins. http://unity3d.com/support/documentation/$$anonymous$$anual/Plugins.html

avatar image
0

Answer by Statement · Mar 16, 2011 at 02:28 PM

I want to know the EXACT moment in time between touches.

The point of interest is exact measurement of tap times independent of frame rate. Possible how?

From the input docs:

The iPhone/iPad screen is able to distinguish quick finger taps by the user. This counter will let you know how many times the user has tapped the screen without moving a finger to the sides.

Android devices do not count number of taps, this field is always 1

See Touch.tapCount. You can get Touches from Input.touches.

I don't know if this solves your problem or not, it apparently it will count the taps for you. If this is frame rate independent or not, I can't tell. If it is frame rate independent it probably won't offer you information about how long it took between each tap as it is only a value describing the number of taps. There exist also a deltaTime variable, but I don't know if you get a touch sample for every little tap. If you do, you can measure the distance in time between taps with this.

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

1 Person is following this question.

avatar image

Related Questions

How do i create mobile menus 1 Answer

touching a gui texture 0 Answers

Touch Controls 0 Answers

How is "Touch.tapCount" bounded? 1 Answer

Frame counter not registering - Component missing? 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