0

我正在通过本教程制作应用程序。

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,

有没有人有同样的问题?

在此处输入图像描述

在此处输入图像描述

4

1 回答 1

3

我有同样的问题,原来我没有在_mouseNode上启用物理。在节点上启用物理解决了这个问题。

于 2014-08-04T14:32:17.500 回答