Making moving box stop moving when it would push another box into wall?

So I am working on a game where you are able to pickup and move boxes around. I want the boxes to essentially behave like kinematic objects when selected. They cannot be affected by other physical bodies, but they can be used to push or lift them. I set it up where it will perform a box cast to prevent it from moving into walls, but whenever it is colliding with other pushable objects, I need it to stop if it would push those objects into the wall (or if they would push a pushable object that pushes another pushable object into a wall).

I’ve had some success with using chains of boxcasts that propagate through colliding objects to detect the walls based on the movement that would be caused by the collisions, but my approach hasn’t been 100% since I am using the movement of the original object to determine how things will be moving. I am not going to be dealing with a large number of pushable objects, but box-casts that spawn box-casts every frame makes me hope for a better way.

I’ve considered making my object not a kinematic object, but I’m not certain how to keep it from responding to the force objects apply to it while still giving it freedom to move and rotate based on player input. I’ve tried making it more massive, but then its inertia can cause issues on smaller mass objects and stacking things on top of it makes it slowly start to sink due to the gravity force applied by the other objects.

The last thing that I have considered would be just having two instances of the physics scene and stepping forward once to see if the movement/rotation would be considered acceptable, but I am not certain what I could check to determine if it was acceptable. Is there a way to check collision point data to determine if pressed up against a wall?

Anyway, any insight would be greatly appreciated! Thanks.

In case anyone else is interested in where this ended up:

I did experiment with doing a secondary simulation and using the Physics2D.Distance (there’s a 3D equivalent of this method as well) method to determine if bodies were overlapping when I stepped the simulation forward. If it was then I could use the normal vector and distance overlap to roll back the position and adjust the velocity accordingly. Sometimes I would have to do more than one iteration to adjust the velocity even further since the first change was not enough. This got especially complicated when you have a large number of objects to check against. I think this could have been a good solution, but needed some work. Definitely getting into the replicating the physics engine territory.

As for what I actually ended up doing, I am using the non-kinematic bodies. But I increase their mass and drag whenever they become selected. The values are mostly determined by what feels good for the object. With the higher mass and higher drag coefficient other dynamic bodies have a pretty minimal effect on the object. They don’t have no effect, but I’ve convinced myself that the slight force they do add feels good. Then I use the MovePosition and MoveRotation methods instead of AddForce. The Move methods will not take the drag/mass into consideration. I still manage the velocity externally so they can have momentum. The nice thing is that I get objects that are not easily moved by other objects, but are stopped by kinematic or static bodies. Which is close enough for what I was wanting achieve.

The easiest way would be to make the movement based on the RigidBody, so using the AddForce() method to move the object would allow it to not phase into walls and stop if an object is in the way.

Rotation can be done using AddTorque()