Moving a hollow container with meshes inside with enabled physics

I have a hollow cube containing an unconnected cube inside it.

Screenshot_20240715_010824_Kiwi Browser

With physics enabled, moving the container just teleports it so the smaller cube (remaining where it is) then becomes outside the container.

I played around with mesh.physicsBody.setPrestepType(BABYLON.PhysicsPrestepType.ACTION) and then changing container.position, but the cubes fall through the STATIC ground and seem to interact erratically.

I can post a playground later in the week, but I wanted to quickly ask to see if this is the right direction.

The hollowed cube is created from containerCSG.subtractInPlace(BABYLON.CSG.FromMesh(insideWallsMesh)), then independently creating/placing another cube inside it. Both cubes have a physics shape attached: hollow container MESH and smaller cube CONVEX_HULL.

Probably you may find some hints in this thread - PhysicsBody with Animated motion type does not have any friction - #2 by Cedric

Please provide a PG so we can take a look.

I’ve yet to provide a playground, but I think I understand.

What, conceptually, is the different use case for

Followed by

mesh.position = newPosition

Versus

mesh.physicsBody.setTargetTransform()

I thought specifying ACTION instead of TELEPORT was for the specific purpose of allowing changes to .position and .rotationQuaternion and enabling collisions between start/end points.

In my case, I’m wanting the position to change instantanously (within a single scene render). But I realize may have to tolerate visual movement over multiple scene render frames and limit the speed of movement to that which is tolerable to the physics engine with respect to object sizes.