x


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!

more ▼

asked May 31 '11 at 10:40 PM

TheodusArcaedim gravatar image

TheodusArcaedim
16 1 1 1

link code

May 31 '11 at 11:25 PM Anxowtf
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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.)

more ▼

answered Jun 01 '11 at 05:53 AM

Owen Reynolds gravatar image

Owen Reynolds
11.5k 1 7 45

(comments are locked)
10|3000 characters needed characters left

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

more ▼

answered Jun 01 '11 at 01:31 AM

RetepTrun gravatar image

RetepTrun
323 9 14 16

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2504
x1880
x1797
x55
x25

asked: May 31 '11 at 10:40 PM

Seen: 1233 times

Last Updated: Jun 01 '11 at 05:53 AM