Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top