I have a top-down game where the player character can push boxes around.
I need the player to be only able to push a box if it is by itself and there is no other box behind it. i.e. one box at a time.
So if you push a box and it is also pushing on another box I need to stop the boxes from moving essentially.
I've tried tweaking the player pushing force, box masses and my friction force to achieve this but the player can still very very slowly move two or more boxes at once. Even if the friction force is tweaked to try and cancel out any very slow movement completely.
I've tried to lock down any boxes that are moving very slowly by calling ResetDynamics() on their body or setting their LinearVelocity to zero if they are moving at a really slow speed but they keep moving. The player character body can still push them slowly
I'm guessing that even by doing this the collision resolution with the playercharacter bumping the box still needs to move it a little bit?
I've also tried to find a way to set the box to Bodytype.Static and only switch it to Dynamic when being collided by something at high enough speed but this caused an exeption in the Timestep solver and seemed like a horrible hack.
Does anyone have any suggestions to prevent this slow, 2 boxes at once movement?