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
1
Question by BenouKat · Sep 17, 2012 at 09:50 AM · inputpluginkeyprecise

Is there a way to get precise input ?

Input is called in frame Update with getKey function, but it means it's verified every 16ms (or more if you dont unable Vsync but still dependent of the framerate).

Is there a way, or a plugin (i got pro), to got very precise input in time ?

Comment
Add comment · Show 10
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 fafase · Sep 17, 2012 at 09:52 AM 0
Share

But what would be the use ot it? Your issue I think is not about checking the input more often but about increasing your FPS. Even if you could check your input every 5ms, the frame rate is still 16ms. So only the last one (or the first one) would be considered. Even if you put 20 letters in the postbox, it is collected once a day. Or I misunderstood.

avatar image BenouKat · Sep 17, 2012 at 09:58 AM 1
Share

It's for a musical game. I need very precise input for checking the exact moment (or with a very nice precision) of when the users push a button.

I don't necessary needs to doing something DIRECTLY when the input is raised, but i just need to know the exact or very precise time of when the users push a key.

Actually, i cheat. I force the disable of VSync, set the targetFrameRate to -1. And, even in a 5 years old computer, i get 200 FPS, which is 5ms accuracy, which is pretty good.

But i was asking for a more "clean" solution ?

avatar image BenouKat · Sep 17, 2012 at 02:48 PM 0
Share

Yep, i already know it's difficult, and of course i don't expect precision to milliseconds. But 5ms will be fine.

I'm just asking myself how others musical games works, are they got the problem too, or are they doing something else ?

avatar image Screenhog · Sep 17, 2012 at 03:57 PM 0
Share

Other musical games cheat, too. They have to. For consoles, they can have the additional problem of latency between a wireless controller and the console. There's also the issue of modern technology like HDTVs and capacitive touchscreens (like on most mobile phones) having performance issues for games with really tight accuracy: http://www.gamasutra.com/view/news/174502/Your_HDTV_killed_PaRappa.php#.UFdIH41lS3Y

avatar image whydoidoit · Sep 17, 2012 at 04:01 PM 1
Share

Can you not use Get$$anonymous$$ey in FixedUpdate (you would have to handle your own Down/Up notifications because they won't work in FixedUpdate)? Then you'd set your fixed update step to be 200x per second.

Show more comments

1 Reply

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

Answer by SarperS · Sep 17, 2012 at 03:59 PM

Here, Sophie posted this, might help. http://www.sophiehoulden.com/super-fast-input-in-unity/

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 BenouKat · Sep 18, 2012 at 01:14 PM 0
Share

Perfect, just perfect, thank you !

avatar image BenouKat · Sep 18, 2012 at 04:05 PM 0
Share

Well.... Testing a bit and ... it's not perfect :D See the comment of "Nicholas" in comment, and he's right. OnGui() is completly frame dependant and the difference between this trick and just put input as usual is nothing.

avatar image Fattie · Sep 18, 2012 at 07:07 PM 0
Share

ok, so that's useless. thanks for the test !

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

14 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

Related Questions

How do you correctly setup multiplayer using InControl? 0 Answers

Having issues with Input.GetKey... 3 Answers

Is it possible to change keyboard input inGame 1 Answer

problem whit input key 2 Answers

Car Enter/Exit Script Problems 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