- Home /
Object w/ constant force can't move on top of other objects
I have a tank (rigidbody) that has a constant forward force being applied to it. When it's on the ground, it moves fine. However when I try to drive up a ramp or jump onto other objects, the tank stops moving forward. These other objects are separate rigidbodies with either mesh or box colliders (neither seems to make a difference). I've tried fiddling with the friction and drag options but nothing seems to change: the tank just fidgets on top of the object. I've discovered that if I drastically increase the forward force when on top of an object, the tank can move, but that doesn't seem like the right solution. Any help at all would be greatly appreciated!
Answer by Owen-Reynolds · Jun 01, 2011 at 05:53 AM
Sometimes putting a rounded edge in front can help -- box colliders tend to stick more. Could try a front flopped-over capsule collider for the tank. If that helps, could then do it right using a compound collider with the capsule in front, sideways-flopped over.
Sometimes always adding a tiny bit of upwards force can also help get over the sticky parts.
I've never tried this, but you could have OnCollision(Enter/Stay?) from the front give a small x-tilt to the tank (so the front angles up to try to roll over things.)
Answer by RetepTrun · Jun 01, 2011 at 01:31 AM
Perhaps the material causes it to stick. Maybe make your tank made of ice then it will be slippery enough.
Linking code would be useful. Or did you just make a rigidbody and add the constant force physics component from the menu?
If you have code, perhaps you should be adding relative force rather than just plain old force