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.