Aashiq Parker
Aashiq Parker

Reputation: 807

Running a Unity simulation with very low frames

I'm doing a machine learning simulation in Unity and I just needed some reassurance of my logic. All the physics events happen in FixedUpdate() and so from what I understand, fluctuations in the frame rate won't affect my results as the correct number of physics calls will be made each cycle (I'm setting the timescale ridiculously high). Does this apply when the frame rate is really low, say 1-5 fps? Can I be guaranteed that the correct number of physics steps will be called as long as I can maintain a frame rate of 1 or above?

Thanks

Upvotes: 1

Views: 1843

Answers (1)

Scott Chamberlain
Scott Chamberlain

Reputation: 127603

You don't even need to have a framerate of 1 for it to work. The physics' loop and the display loop (FixedUpdate() vs Update()) are independent of each other. Even if you have a below 1 FPS framerate your physics updates should still apply correctly, it will just do multiple physics steps to "catch up" before it renders the next display frame. See this article from the unity documentation for more information about the order things get called on.

image

Upvotes: 1

Related Questions