diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index e758fe0d70..b451526062 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -1100,6 +1100,7 @@ void Node::removeAllChildren() this->removeAllChildrenWithCleanup(true); } +#if CC_USE_PHYSICS void Node::removeFromPhysicsWorld() { if (_physicsBody != nullptr) @@ -1112,6 +1113,7 @@ void Node::removeFromPhysicsWorld() child->removeFromPhysicsWorld(); } } +#endif void Node::removeAllChildrenWithCleanup(bool cleanup) {