Box2d problem with perfomance

My cocos2d-x app using box2d and physics is slowly. If I use world->setSpeed(2) then app lags sometimes. What to do with this low perfomance? How to increase speed of my game?

Did you setup cameras? I used Box2D directly and before setting them, objects appeared to move slowly but that actually was unit scale issue and cameras.

Cameras? Never hear about them before. Could you link me?

Here is what I used as reference How to use new Camera system? . Modifying default camera Camera::getDefaultCamera() through lookAt() or setScale() might be enough, depending on what you need.

1 Like

thanks, I would try it!