Hi i want to know about CCcamera actions when body moving vertically and how camera follows the body without changing the other bodies positions on the background plz help me

if (body~~>GetPosition.y<=300)
{
b2Vec2 position = body~~>GetPosition();
CCPoint myPosition = this->getPosition();
CCSize screenSize = CCDirector::sharedDirector()>getWinSize;
// Move the camera.
if
{
myPosition.y = MIN (screenSize.height * 2.0f - screenSize.height, position.x * PTM_RATIO - screenSize.height / 2.0f);
this
>setPosition(myPosition);
}
}


HelloWorldScene.cpp.zip (12.4 KB)

plz give me reply