I’m looking for a way to get the current scene and set camera debug, but i get invalid access ;/
auto scene = HelloWorld::scene(); director->runWithScene(scene);
scene:
Scene* HelloWorld::scene()
{
auto scene = Scene::createWithPhysics();
scene->getPhysics3DWorld()->setGravity(Vec3(0,-10,0));
scene->getPhysicsWorld()->setAutoStep(false);
scene->getPhysics3DWorld()->stepSimulate(1 / 100);
scene->getPhysics3DWorld()->setDebugDrawEnable(true);
auto layer = HelloWorld::create();
layer->SetPhysics3DWOrld(scene->getPhysics3DWorld());
scene->addChild(layer);
return scene;}
access:
Director::getInstance()->getRunningScene()->setPhysics3DDebugCamera(camera);
SOLVED
static cocos2d::Scene *scene; outside class