0

I have this issue with Box2D physics where objects will tunnel through walls if the lag in the game is high enough. The game lag is something I'm working on but I think its kinda inevitable that something is eventually going to cause the game to lag and the last thing I want is for the player to walk through a wall when the lag spikes just enough.

Yes I've turned on continuous collision detection and enabled the objects I want to have bullet physics but the problem persists. Any advice? I thought maybe if I slowed the world down proportional to the FPS but I'm not sure how to implement this cleanly or if cocos2d/box2d had a simple fix for this type of issue.

Parad0x13
  • 2,007
  • 3
  • 23
  • 38

1 Answers1

0

Try using a fixed timestep. Variable timesteps are generally disadvantegous for physics simulation.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
  • I'll try this! I also notice the physics get all smudgy and wall-warpy when someone texts you mid game etc... – Parad0x13 Nov 08 '12 at 01:33