coco2dx 3.2 m_world->addJoint 报错

基本上全按照Demo来写的:
1、
void setPhyWorld(PhysicsWorld* world){ m_world = world;}
2、
auto scene = Scene::createWithPhysics();
scene->getPhysicsWorld()->setDebugDrawMask(PhysicsWorld::DEBUGDRAW_ALL);
auto layer = HelloWorld::create();
layer->setPhyWorld(scene->getPhysicsWorld());

3、
if (m_world != nullptr)
{
m_world->addJoint(PhysicsJointPin::construct(sp1->getPhysicsBody(), box, sp1->getPosition()));
}

执行addJoint的时候就报错了,是我使用方法不对吗,求大牛指点

感觉是我的m_world问题,都没有进去addJoint 有其他人遇到这样的问题 吗

我也遇到这个问题了,。。。楼主解决了吗

解决了,是我自己代码写的有问题

我也遇到了,最后发现是不能写在init方法里,因为this指针还没 什么什么。。。再研究研究。我写在onenter里就好了

我写onEnter也不行~ :12: :12: