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 GameFreak · Jan 09, 2012 at 10:21 AM · iphonedeltatimetapunityiphone

Touch.deltaTime confusion

When I Debug.Log(Touch.deltaTime) I get weird times such as 0 0 0 0.00023 0.0052 and so on.

I need the time in seconds how can I do that?

Like I want to know how FAST the user is tapping the screen.

How can I achieve that? Thanks

Comment
Add comment · Show 6
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 syclamoth · Jan 09, 2012 at 10:27 AM 0
Share

Define 'Fast'. Do you mean how hard the user is pressing the screen? Because I'm not sure that you can actually know that. Touch.deltaTime is telling you the amount of time between inputs- it doesn't tell you how fast the user is doing anything, it tells you how fast your refresh rate is on the touch inputs!

avatar image GameFreak · Jan 09, 2012 at 10:39 AM 0
Share

Thats exactly what I want to know the Time between the touches. For example the faster ($$anonymous$$ore touches in lesser time) the speed of the character should increase. Nothing to do with a single hard touch.

Just like if time between touches is little it should move faster and if the time is large (slow touches) the speed should decrease. I have a var called speed So all I want to do is When fast touch--> speed +=1; and when slow speed -=1;

avatar image syclamoth · Jan 09, 2012 at 10:53 AM 1
Share

Ok then. Well, if you're looking for the time between individual touches (on-off-on-off) then Touch.deltaTime isn't what you're after. Touch.deltaTime will give you the time between updates of the same touch. Ins$$anonymous$$d, you should have some kind of counter which checks for the beginning of touches, and increments some kind of touch density counting algorighm. So, if you have x touches in y seconds, the speed changes accordingly.

avatar image GameFreak · Jan 09, 2012 at 11:08 AM 0
Share

Oh I get it.

So theres no inbuilt feature for that? I ll have to use something like if (touch.phase == iPhoneTouchPhase.Began) var a += 1;

But then what :/

avatar image syclamoth · Jan 09, 2012 at 11:35 AM 1
Share

Well, then every second (or half a second or whatever), you poll it to see how many touches have been made in the last second! Or, you could see how long there is between touches. There are a few different ways, but I'm sure you can work one out yourself. It doesn't require any program$$anonymous$$g knowledge, you just have to know exactly what you want to find out, given the information you have available to you!

Why would there be an inbuilt feature for that? That's like having an inbuilt feature for detecting specific words on the keyboard. You have to code this stuff!

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Taping in UnityIphone. URGENT! 2 Answers

Does UNity iPHOne work 1.7 work with the new iPhone 4 os? 1 Answer

Making a GUI Texture tappable on iPhone 4 Answers

BCE0019: is not a member of 'UnityEngine.Component' when trying to Build and Run iOS Unity 2 Answers

From Mouse To Iphone Touch Code 0 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