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 RichardG · May 15, 2014 at 05:57 PM · joystickgamepadprecisiontiming

Precise gamepad timing

Hello

I'm working on an application where I need very precise timing for gamepad inputs. Ideally, down to the millisecond, with multiple presses of the same button being possible within a few milliseconds. (The controller isn't actually a gamepad; it just uses the guts from a gamepad, with the buttons connected to other sensors.)

Unfortunately, it seems that gamepad button pushes are linked to Update, not Fixed Update. It's not possible to change the Fixed Timestep and use FixedUpdate because the results don't change until Update runs again. (E.g.: If the app is running at 60 FPS, Update is called every 16.667ms. If I set FixedUpdate to run every 2ms, ButtonDown will return true 8 times or so times in a row when I want it to return true only once.)

I'm currently working on Mac OS X (10.9.2/Mavericks) and don't currently have a way to confirm this on other platforms.

Is there a way to achieve the desired precision inside of Unity? If not, are there any existing libraries that do provide this functionality?

Thank you.

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 meat5000 ♦ · May 15, 2014 at 06:27 PM 0
Share

Can you not place your input checks in FixedUpdate ins$$anonymous$$d?

For a similar problem with $$anonymous$$ecanim I simply changed a flag then record state to LastFrame variable. If-check for Press true this frame && false last frame, so repeat Press = true has no effect.

I did it this way so I could inject changes to Press (attack in my case) from other scripts with less problems and stick in an easy attack-on var with a timed off.

avatar image Jeff-Kesselman · May 15, 2014 at 06:52 PM 0
Share

If you're using Unity Pro you could always build your own plugin and go straight to the OS with platform specific code.

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

22 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Generic USB Controller axis issue 0 Answers

Game Controller support for Unity Metro (aka Windows Store app) 1 Answer

Precise timing of user responses 2 Answers

How do you change the joystick axis boundary from a circle to a square? 1 Answer

Joystick gamepad input overly sensitive 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