|
Please correct me if I'm wrong in this paragraph - the maximum FPS you'll get from a game depends of FixedTimestep. If your CPU calculates each frame in time, you get the maximum FPS (assuming you got the best graphics card in the world and it always draws on time), if it doesn't, you'll get an actual game slowdown opposed to a visual lag caused by a possible bad graphics card. The FixedTimestep of a project is by default set to 0.02 which gives 50 expected frames per second. I want 60 frames per second like games usually have, but for that I'd have to set it to 0,0166666666... So the value will get clamped. What should I do here? Once I set a FixedTimestep value and accept it, there's no turning back, because I'm doing a lot of things dependent of Time.deltaTime, and I don't want them to speed up or slow down as I change FixedTimestep (If there's a way to avoid that too, how do I do it without messing with TimeScale?)
(comments are locked)
|
|
The fixed timestep is for physics. Do everything in coroutines or Update, and do nothing in FixedUpdate except physics calculations. The only reason to change the fixed timestep from the default .02 is if you want the physics engine to run more or less often than 50 fps. The framerate of your game is "as fast as possible" normally, with the following exceptions: 1) vsync is on, in which case the framerate is limited by how fast the monitor refreshes, or 2) you set Application.targetFrameRate to something greater than 0, in which case the framerate will (more or less) not exceed that value. So if I'm making my own physics script, I should put its code in fixedUpdate() and use Time.fixedDeltaTime instead of Time.deltaTime for the physic-dependant object movement, right? While the rest of timed things like counters should always be multiplied by Time.deltaTime?
Jan 22 '10 at 07:02 AM
Micha Lewtak
You should continue to use Time.deltaTime, actually. In a FixedUpdate function it will still give you the correct time delta.
Jan 24 '10 at 05:30 PM
Eric5h5
(comments are locked)
|
|
FixedTimestep only applies for the rate FixedUpdate() is called. I think the normal update is called as often as possible (depending on cpu). If you are using Time.deltaTime for all you movement you should be fine. The FPS does not depend on FixedTimestep.
(comments are locked)
|
