Rigidbody slipping when reaching the edge

Hello everyone,

i’ve been having this problem for a while, it’s when my rigidbody character start slipping when it’s on the edge of something.
here’s an example photo

it’s on the edge and then it start going slowly until it falls. but i want it to stop moving if i’m not moving it.

i’m using JS, and not using the 2d features

Thanks!

In the image you can easily observe that center of mass of upper cube is applying mg force on that that’s why it is falling. Keep the gravity 0 for the upper cube then you can achieve whatever you want.