Type Function Library physics.* Return value Boolean Revision Release 2021.3646 Keywords physics, stop, stop physics See also physics.start() physics.pause()
Stops the physics engine. This function will return
false and display a warning message if the API cannot be processed.
This API is treated as a request to destroy the physics world, so if you merely want to pause the physics engine, you should use physics.pause() instead.
This call cannot be used in a collision event. However, your collision handler may set a flag or include a time delay via timer.performWithDelay() so that the action can occur in the next application cycle or later. See the Collision Detection guide for a complete list of which APIs and methods are subject to this rule.
local physics = require( "physics" ) -- Start the physics engine physics.start() -- Stop the physics simulation after 2 seconds timer.performWithDelay( 2000, function() physics.stop() end )