Stability of stacked cubes in DOTS physics

Hi

I know it’s in preview, so I was having a good look at DOTs physics before maybe using it for an upcoming game.

As a basic test I made a stack of cubes and I was unpleasantly surprised to find that Unity Physics doesn’t seem to be able to stably simulate a stack of 4 cubes without it falling over.

It’s entirely possible that I’ve made some sort of mistake in the setup so I thought I should check in here.

I’ve got one stack of regular monobehaviour physics cubes:

one stack of non-DOTs physics components converted using the Convert To Entity

and one stack of cubes converted by Convert to Entity using the Physics Body & Physics Shape

when I press play in the editor the legacy physics cubes land in a stable stack, both stacks of DOTs physics cubes initially land stable-ish, then they slide about and fall over:

I’ve attached the unity project in case it helps get to the bottom of it.

I was also wondering if this was a known issue, as I recall reading in the docs that the new Unity Physics system is stateless, and I know that lots of objects in static contact is actually a tricky problem which physics engines I’ve used before use cached contacts to help deal with.

oops! forgot the project - here it is :slight_smile:

7026439–832345–UnityPhysicsTestClean.zip (26.3 KB)

In general, Unity Physics is not the best choice if you want stable stacking. It is a stateless Physics engine. If you want stable stacking and you want DOTS, you need either Havok or roll your own calculations.

Short video demo of stacking

Please read Unity - Unity Physics 0.4.0 - Contact Solver Stabilization Heuristic - Unity Forum

2 Likes

I can appreciate that the stateless approach essentially precludes stable stacking but it’s pretty much a base level requirement from a physics engine for a game right?

TBF this is really a pretty poor situation - as a pro user this means I will have to pay an additional cost for a 3rd party physics solution in order to be able to use DOTS physics to make a game with “standard physics behaviour” :-/

I’ll go and have a look at this, thanks for pointing me to it :slight_smile: