• 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 Zenith08 · Jun 27 at 05:53 PM · fpsfixedupdatestutter

Fixed Update Versus Monitor Refresh Rate

I'm working on a game where we update the position of our objects manually every FixedUpdate so that it is frame rate independent. FixedUpdate runs at 50hz by defualt (we haven't changed it), meanwhile our game will run at probably 30 or 60 fps.

Does this have a risk of creating stuttering where our objects do move in one frame and do not move for another frame? Or at 30fps when an object updates once in one frame but twice in another? If so, are there any known solutions?

Thanks!

Comment
Add comment · Show 3
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 tormentoarmagedoom · Jun 27 at 06:41 PM 1
Share

Hello.

I supose you know, but look here.

https://docs.unity3d.com/Manual/ExecutionOrder.html

you will find links to almost every part of the Unity frames/updates/render, etc.

avatar image Zenith08 tormentoarmagedoom · Jun 28 at 05:09 PM 0
Share

Hi, I have seen this document, what I'm not sure about is if it matters. Like I know that the Fixed Update may be run more than once in a frame but at 30fps I would expect FixedUpdate to run twice in 20 frames and once in the other 10 determined at random, this seems like it would create frame pacing issues and as a result stutter. Has anyone experienced this or have any insight on this problem? Thanks!

avatar image Zenith08 tormentoarmagedoom · Jun 28 at 05:13 PM 0
Share

Also is the implication from that document that FixedUpdate is guarenteed to run at least once per frame? So a game running at 60fps will have at least 60 FixedUpdates per second (At the default 0.2 setting on Unity Physics) becaue that seems like it would cause problems and slowdown in the other direction.

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by onetimepad · Jun 28 at 07:55 PM

For VSync there is QualitySettings.vSyncCount = 1; There is also Application.targetFrameRate=60; FixedUpdate is for calculating physics, not displaying frames etc. To avoid movement stuttering you can use Time.deltaTime for multiplication -> if frames drop delta will be bigger.

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

Answer by tormentoarmagedoom · Jun 28 at 05:16 PM

As far as I know, update and fixed update lenght depends on all code depending on them.

If you want movement independent from frames, maybe you should use time.deltatime or coroutines with yield WaitForRealSeconds

https://docs.unity3d.com/ScriptReference/WaitForSeconds.html

https://docs.unity3d.com/ScriptReference/Time-deltaTime.html

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

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

Related Questions

Value updating only once per second (FIXED, had nothing to do with updates) 1 Answer

Objects stutter when using First Person Controller? 4 Answers

Game runs smoothly in landscape mode but lags/stutters in portrait! 1 Answer

Stuttering Game problem 1 Answer

issue with jerkyness (jittery rendering/movement) every couple of seconds. 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