- Home /
Custom FixedTime?
Is there a way to create an Alternate Fixed time update? I'm currently using the unity FixedUpdate for player movement which I need to run at 60fps for consistency in motion. The problem is the Physics Engine uses the same interval to update and uses unnecessary processing. My game runs on iOS so it is important for efficiency.
Is there a way to create a different fixed update thread using Invoke or something?
Answer by rutter · May 02, 2012 at 02:20 AM
You could use a coroutine, maybe: http://unity3d.com/support/documentation/ScriptReference/index.Coroutines_26_Yield
Unfortunately, Coroutines don't actually solve this problem at all. There are quite a few detailed discussions about this problem lying around this site, and the general consensus is that it's basically impossible to get millisecond-accurate fixed frame times (which has unfortunate implications for rhythm games etc.). In my experience, it's not even possible to force the screen to update at the same rate as the monitor- V-sync doesn't actually work properly, so you can't even eli$$anonymous$$ate $$anonymous$$ring.
This is unbelievably annoying, and I wish the folks at Unity would fix it...
I've never seen vsync not work, but you can't rely on it for ti$$anonymous$$g anyway, since the computer might be really slow, or the user has a different refresh rate (not everything is 60Hz).
Really? $$anonymous$$ake a simple scene with a bouncing box and moving camera, and then turn on Vsync. Don't tell me you don't see $$anonymous$$ring there.
Your answer
Follow this Question
Related Questions
Proper fixed timestep values to not punish the game framerate 2 Answers
When exactly is OnStateUpdate called for different AnimatorUpdateMode-s? 1 Answer
Physics.OverlapSphere on IOS 0 Answers
How often does the internal physics calculation get called? 1 Answer
How to make code in FixedUpdate() independent from fixed timestep? 1 Answer