How to snap my dice flat to the floor after rolling.

In my game I am rolling physics enabled dice. The problem is that sometimes they do not land exactly flat. Sometimes they stop against a wall or another die. Sometimes they stop by themselves but seem to be balanced on an edge of the die.

How can I ensure that all the dice stop rolling in a flat position? This is not a gambling game so it’s ok if it’s not a 100% mathematically random scenario. Just has to be “random enough”.

Thanks

You can move the center of mass of your dice (move it down or under), this will make it so they will always land flat on the same side though lol. But since you said it doesn’t matter, depends on what you trying to do.

You could also move the center of mass dynamically. So when your dice fall sideways or whatever, you move the center of mass to a position that will make them fall flat so that the side that was closest to being flat will be the one that it lands on. You could play with that to get the result you want.