From 280e620f64ac6b695b9935f5a283fe454bd78c8f Mon Sep 17 00:00:00 2001 From: "jiaxin.lai" Date: Thu, 20 Jun 2019 09:35:15 +0800 Subject: [PATCH] before destroy make sure the body is deactive (#4656) --- cocos/3d/framework/physics/detail/physics-based-component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cocos/3d/framework/physics/detail/physics-based-component.ts b/cocos/3d/framework/physics/detail/physics-based-component.ts index b8a1006438..793a003060 100644 --- a/cocos/3d/framework/physics/detail/physics-based-component.ts +++ b/cocos/3d/framework/physics/detail/physics-based-component.ts @@ -271,6 +271,9 @@ class SharedRigidBody { } public destroy () { + // before destroy make sure body is deactive + this._deactiveBody(); + this._body.setUserData(null); (this._body as any) = null; (this._beforeStepCallback as any) = null;