physics.stop()

类型 函数
physics.*
返回值 布尔
版本 发行版 2024.3703
关键字 物理,停止,停止物理
另请参见 physics.start()
physics.pause()

概述

停止物理引擎。如果 API 无法处理,该函数将返回 false,并显示一条警告消息。

陷阱

语法

physics.stop()

示例

local physics = require( "physics" )

-- Start the physics engine
physics.start()

-- Stop the physics simulation after 2 seconds
timer.performWithDelay( 2000, function()
    physics.stop()
end )