- Home /
Box pushes another box while it's supposed to move on top of it
Hello!
I'm working on a game where the player needs to manipulate boxes by pushing them. I have a problem where the box that i push is pushing another box, while it's supposed to slide on top of it.
(In the picture the player is a white box on the left, pushing a big box to the other big box)
The thing is, sometimes it works, sometimes it doesn't. I've tried changing physics setting such as Default Contact Offset and Fixed Timestep, the rigidbodies collision detection, sleep mode and interpolation. I've changed the physics material, and I tried changing to Polygon2D instead of Box2D and to round all the corners manually.
Nothing worked. I've been able to reproduce this problem in every single thing I've tried (sometime took a few tries).
I would love to know what more I can do to try and fix this.
Have a great day and thank you for your time, Roee.
Edit1: after a lot of test, I've realized that the rigidbodies sink into each other, causing this problem. no idea how to fix it though.
Are your boxes allowed to rotate?
Did you create a physics material for less friction?
they are not allowed to rotate. I've tried it both with and without friction.