Game Logic: setMaxPhysicsFrame

setMaxPhysicsFrame(maxPhysics)
  • Sets the maximum number of physics updates executed per render frame.

maxPhysics:

  • Type: integer
Note:
  • Higher values allows physics to keep up with realtime even if graphics slows down the game.
     
  • Physics timestep is fixed and equal to 1/tickrate.
     
  • (Max physics)/(tic rate) is the maximum delay of the renderer that physics can compensate.
Sample Code

################## set the maximum physics updates executed for each render frame
  

# import bge
import bge

# set the max physics update rate
bge.logic.setMaxPhysicsFrame(4)