I intend to develop an excavator game. Excavator modeling based on cinema4d (trial version)
I try to define the soil as lots of small cubes (rigid bodys with box colliders), also i add the box collider to the shovel of the excavator.
But they two can't collide with each other when the small cubes are defined to be very small and with big weight.
Having lots of small cubes simulating dirt appears to me to maybe not be a good plan. As Dwair pointed out, having many small colliders can be quite a nightmare for the physics engine.
You could consider having a mesh for the excavation site and procedurally modifying the mesh when the player digs. It will probably take a lot of tweaking to get right though.
answered Apr 12 '10 at 11:23 AM
Did you put rigidbody component to the shovel too?
It is very important both phys colliders have mass, if you don't want the shovel to bounce or make funny movements, just use isKinematic and there you go!
The other part about "Small colliders" worries me most, small colliders are a headache for any physics engine, the only thing I can think of is modifying physics settings: You'll probably need to reduce min penetration for penalty and increment solver iteration count...
Another useful thing if colliders are moving fast is DontGoThroughThings
Anyway, interesting game you are making!
answered Apr 12 '10 at 10:30 AM
Why do they need to collide with each other? Can't you just make the shovel tool follow the mouse cursor and use OnMouseDown() of the soil-cube to determine which cube to scale?
answered Apr 12 '10 at 07:37 AM
I have made an excavator using only rigid bodies and I can pick up thing fine with the bucket,
for forum entries: http://forum.unity3d.com/threads/66871-Excavator-simulation
if you need help with your build, let me know. the picking things was not the hard part, the rigging of the arms was for a totally predictable, stable and reliable rig.
basically the big trick is to increase the solver Iteration count and adapt the time settings. Otherwise, joints are not tight and it becomes utterly unstable. My demo has quite large objects to pick up, but I tried with smallers during build phase and it can handle it fine.
answered Nov 18 '10 at 11:20 AM