I am trying to make fully destructible buildings made out of rigid body bricks, I have done this before just for fun but now I want to make a city. To improve performance I want to suspend the dynamics of the bricks that are farther away from the player. however when a dynamic object collides with a suspended dynamic object it will randomly jump or fly off, so when the buildings become dynamic they blow themselves apart before I get to shoot them. Why do the suspended objects do this? is there a way to stop this?
The code I am using works fine except for the premature exploding; here is the code I’m using to make the bricks suspend/unsuspended if you want to take a look:
cont = GameLogic.getCurrentController() own = cont.owner Player = GameLogic.getCurrentScene().getObjectList()["OBPlayer"] if own.getDistanceTo(Player) <= 20: own.restoreDynamics() else: own.suspendDynamics()