Help with Make Camera follow player

//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;
};

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

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 ?

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

1 Like