Help with Make Camera follow player

Help with Make Camera follow player
0.0 0

#21
//CREATE SCENES AND LAYERS SAMUEL - PHYSCIS DEBUG OPTIONS- DANIEL
cocos2d::Scene* FirstWorld::createScene()
{
	auto FirstWorldScene = Scene::createWithPhysics();
	FirstWorldScene->getPhysicsWorld()->setDebugDrawMask(PhysicsWorld::DEBUGDRAW_ALL);
	FirstWorldScene->getPhysicsWorld()->setGravity(Vec2(0, 0));

	auto layer = FirstWorld::create();
	layer->SetPhysicsWorld(FirstWorldScene->getPhysicsWorld());
	FirstWorldScene->addChild(layer, 0);

	return FirstWorldScene;
};

#22

layer would probably be your equivalent of worldNode. So in FirstWorld, you would use this instead of worldNode.


#23

Ok that may bring me back to same problem…

I was just just using this

this->runAction(cocos2d::Follow::create(playerVehicleObject->getSprite()));

This is a problem because I cannot add particles to the scene without them following the vehicle as if there on same layer as vehicle

I just do this->addChild(particles) and they trail along after the vehicle

Is this way your showing a way around this ?


#24

No. I don’t use particles, so I am not sure how to stop them from moving with a node.