我正在关注此链接以开始使用Sprite Builder。
https://www.makegameswith.us/tutorials/getting-started-with-spritebuilder/spritebuilder-physics/
我做了一个这样的联合:
_penguinCatapultJoint = [CCPhysicsJoint connectedPivotJointWithBodyA:_currentPenguin.physicsBody bodyB:_catapultArm.physicsBody anchorA:_currentPenguin.anchorPointInPoints];
我得到一个错误说:“通过关节连接的身体必须添加到相同的CCPhysicsNode”
我按照此链接寻求解决方案: Bodies connected by a joint must be added to the same CCPhysicsNode, however two bodies are under the same CCPhysicsNode but
它说要启用我已经完成的两个对象的物理属性,我仍然会收到错误:
'通过关节连接的身体必须添加到相同的CCPhysicsNode。'
为方便起见,我将从spriteBuilder上传图片
请帮忙。
答案 0 :(得分:0)
检查您正在添加新企鹅的CCPhysicsNode,即:
// add it to the physics world
[_physicsNode addChild:_currentPenguin];
在这种情况下,它已添加到_physicsNode
。
返回Gameplay.ccb
(在SpriteBuilder中),检查名为CCPhysicsNode
(Doc root var)的_physicsNode
是否与您添加catapultarm
的位置相同。