The SubSteps
property of the PhysicsWorld
class allows you to control the number of substeps that the physics engine performs per tick. This can be useful if you are experiencing issues with objects passing through each other or if you have a low tickrate. By increasing the number of substeps, you can achieve more accurate physics simulations at the cost of increased computational load.
The default value for SubSteps
is 1, which generally provides a good balance between performance and accuracy. However, if you find that your physics simulation is not behaving as expected, you may consider increasing this value.
It is important to note that the total number of physics ticks per second is calculated as tickrate * SubSteps
. For example, if your tickrate is 90 and you set SubSteps
to 1000, the engine will perform 90,000 physics steps per second, which can significantly impact performance. Therefore, it is crucial to adjust this value carefully based on your specific needs and performance constraints.