问题
I am making application by this tutorial.
https://www.makegameswith.us/tutorials/getting-started-with-spritebuilder/spritebuilder-physics/
I made jointnode directly in code like this
_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];
but even though surely two nodes are under the same CCPhysicNode,
it shows this error
Bodies connected by a joint must be added to the same CCPhysicsNode,
Does anyone have same issue as this?
回答1:
I had the same problem, it turns out I had not enabled physics on the _mouseNode. Enabling physics on the node solved the problem.
来源:https://stackoverflow.com/questions/24364897/bodies-connected-by-a-joint-must-be-added-to-the-same-ccphysicsnode-however-two