Reputation: 807
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
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.
Upvotes: 1