Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by keysosaurus · Sep 09, 2016 at 04:22 PM · inputfpsframeratefirst-personfirst person

Player input independent of frame rate?

Hi, I'm trying to work out the best way to calculate player input independent of frame rate? ie. if the game stutters or player changes to a lower/higher frame rate, looking around in first person always feels the same.

I know Unity is working on separating input from the main thread in a future update, but has anyone any ideas on how best to go about it currently? (version 5.3.5/5.4)

If I do all my input calculations in FixedUpdate it seems to work nicely, but I get a strange stuttering effect which looks to be caused by the framerate and the input being out of sync sometimes.

If I calculate everything in Update, I can't seem to then get it to be framerate independent, as input will feel broken at low frame rates and way too sensitive at high ones.

Any help or ideas would be very welcome, cheers!

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 ScaniX · Sep 10, 2016 at 06:16 PM 1
Share

What are your "calculations"?

If you just mean to make your character move with the same speed in any framerate, you just need to add time dependeny with the factor Time.deltaTime, like in any movement or animation, actually.

Also it is not good to retrieve the input in FixedUpdate() as input is working per frame, e.g. $$anonymous$$eyDown() returns true during the frame that the user started to press the key. When retrieving this in FixedUpdate(), some of it might get lost.

avatar image Sergio7888 · Sep 11, 2016 at 01:56 AM 1
Share

Your real problem is not the input, your problem is the framerate, if you have low frame rate try reduce your resources or use the profiller

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by AurimasBlazulionis · Sep 09, 2016 at 04:33 PM

Simple answer. Now you can't. Unless you write your own library for getting inputs, but then you will have to compile it for every platform you want to use.

Comment
Add comment · Show 1 · 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 keysosaurus · Sep 09, 2016 at 04:56 PM 1
Share

Yea, Unity say they are working on separating it from the main thread, but I'm wondering what the best way to go about it or get close to it at the moment would be

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

framerate suddenly drops in iphone 11 pro max 1 Answer

Why would render textures lag the oculus and not the editor? 2 Answers

Setting Frame Rate failed. 0 Answers

Mouse movement disables Vsync (leading to very bad stuttering) 0 Answers

reduce FPS drops from Shuriken Particle System in 2D 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