Download

Help Creating Natural Physics for a Weighted Cube

I’m trying to create what I can best describe as a weighted cube. Essentially I have a cube object that the player can carry around, throw, stand on, etc. (Think companion cube from Portal but can be tossed).

All of the actions I can do with cube function fine. However, I’m having issues getting the physics on the cube to feel natural. By default my cube basically tumbles around like an empty cardboard box. It will go flying across the room if anything hits it and tumbles repeatedly when it is thrown. I’ve fixed some of this by overriding the mass of the cube and increasing that value. Now the throw is much more natural and the cube only goes the distance I want it to. I fixed some of the rotation issues by decreasing the Max Angular Velocity of the cube so it doesn’t tumble uncontrollably. However, I’m still having issues with the physics.

My current problem is if I’m carrying a cube and the held cube knocks another cube on the ground, the ground cube will get knocked across the room like it has no weight. If I toss a cube at another cube, this doesn’t happen. If as the player I push up against the cube it resists my push a bit and slowly tumbles over (although I’d prefer if it slid). I’m at a loss as to why this is happening or how to fix it.

I’m hoping that someone can give me an idea as to why a held cube applies so much force to cubes on the ground. I’m hoping that someone can give me some suggestions as to how to make the cube feel like it has some weight to it in all circumstances. And if anyone has suggestions as to how to make the cube slide when being pushed versus tumbling over, that would also be great. Any suggestions are appreciated.

Substepping is ON, right?
In the details panel/physics of the cube there should be position solver iterations and velocity solver iterations. I always use 10x higher for both. This helps me often.

I think the carrying cube ~> pushing other cubes too hard stuff is related to the way you carry it. If you apply a sudden position shift, then this might happen without a physical force. So the cube just occupies the position of the other cube in one frame or there is instant overlap and the other cube flies of. The proper way to carry it, even if cumbersome to do, might be to the apply forces to it. For example a fixed force upwards that cancels gravity, and then two horizontal forces for left/right and forward/back. The amount of force can be coupled to the character movement. Like a hoover-cube, but with very direct reaction to movement of the character. This would also replicate real carrying in terms of forces.

How are you holding the cube? If you have it “locked” to your player, then its weight and other physical parameters will have no effect, since it is being “forced” through space. Try attaching the cube to the player using a spring constraint, this will allow it to “push” against objects in the world using natural physics. This can be tricky to setup (mostly due to poor documentation), but the results will be much better.

Also, another thing to look at to make it feel more realistic is the angular and linear damping values – I generally find these need to be higher than the defaults to keep an object from spinning out of control.