我正在通过本教程进行申请。
https://www.makegameswith.us/tutorials/getting-started-with-spritebuilder/spritebuilder-physics/
我直接在像这样的代码中创建了jointnode
_mouseJoint = [CCPhysicsJoint connectedSpringJointWithBodyA:_mouseJointNode.physicsBody bodyB:_catapultArm.physicsBody anchorA:ccp(0, 0) anchorB:ccp(34, 138) restLength:0.f stiffness:3000.f damping:150.f];
但即使两个节点肯定在同一个CCPhysicNode下,
显示此错误
Bodies connected by a joint must be added to the same CCPhysicsNode,
有没有人有同样的问题?
答案 0 :(得分:3)
我遇到了同样的问题,事实证明我没有在_mouseNode上启用物理。在节点上启用物理解决了这个问题。