- Home /
Wheel Colliders and Rope Bridges
I have a somewhat odd physics problem involving wheel colliders. At this point I don't know whether or not I can keep using the built in physics objects or roll my own controller but I have a relatively stable 'dune buggy' that is locked on a plane in its motion using rigid body constraints.
I made a 'suspension' bridge made out of a bunch of linked boxes connected via character joints. There is a lot of sag in the bridge but I can adjust that through mass settings, from an orthographic view the combined colliders create a smooth curve surface. When the dune buggy lands on the bridge from the air I suspect a 'rubber band' like effect which does occur. But what happens is that the rigidbody picks up incredible speed from the wheel colliders. When the car is set to 0 motor torque, and 0 brake torque on a non jointed hill with the same shape, the dune buggy just rolls into the valley. I expect the same from the bridge but it gets 'launched' as if it has some kind of speed boost.
So, any hints or suggestions on making a rope based bridge compatible with wheel colliders as if the bridge were normal terrain ?
After playing with numbers and outputting debug values. If I pause the game and drop the car onto the bridge the second it hits the bridge the wheel's rpms just to 400+ and the rigidbody's velocity jumps in a single tick. I also tried making drag = 10000 and angular drag = 10000 to be equivalent 'sturdiness' of a non rigidbody with extreme mass, and I get the same results.
That is a pretty weird issue... sounds like a "bug" though I doubt this exact setup was conceived... have you tried giving the planks a physics material with a huge friction (not perfect I know).
It definitely feels like a bug as once I remove the joints from the bridge keeping everything else the same, the bridge acts like a normal ground terrain. I have tried hinge and character joints and get the same destabilization. $$anonymous$$y 'bridge' is made up of a line of cubes evenly spaced apart in a straight line. I was trying to make a tight walk rope of some kind that would 'sag' when my motorcycle rode across it.
Its almost like it becomes an instant infinite yield rubber band, event hough the bridge doesn't move much, the relative mass of the segments to my car are pretty high. Turning off gravity on each link seemed to help a little but it just delayed the destabilization for 5-10 frames'
This might be a problem with PhysX and Rigid Body intersection. Physics engines don't tend to really like objects being inside each other, and accelerate them away from each other at high velocity. What might be happening is the bridge could be moving, intersects the wheel collider, which then reacts by the huge movement. This is just a guess though. You could try setting the collision detection to continuous, which might make a difference.
Answer by Jeston · Jun 16, 2011 at 08:22 PM
I have another update, still having the same issue. It seems whenever the object underneath the wheel colliders has rotation or velocity this is occuring. I tried to boil down to a much simpler case, so now I have a sphere with locked rotation except in 1 axis and a constrained position, essentially acting as a 'rolling pin' Whenever my car lands on this sphere it bounces with incredible velocity in 1 tick....
Even more interesting is that the mass of the rolling pin has no effect 0.0001 and 10000 mass still causes the first collision to give the car near infinite velocity, and the rolling pin spins and ridiculous rates on collision
Man, it would be nice to use wheel colliders with other physics constructs, like a rocking bridge, or rolling pins.
Answer by Taibr · Jan 21, 2012 at 04:34 PM
Don't know if this will help, I had a problem with physics and parts of my object were ejected to the space after about 5-10 sec of applying gravity. Then I realized I have a rigid body on empty object it was parented to. After removing rigid body component from parent, it works just fine
Your answer
Follow this Question
Related Questions
Using HingeJoint2D to Join Objects at Specific Points 2 Answers
Circular Joints? 0 Answers
Interactable vines in 2d platformer 0 Answers
Swing Platform 0 Answers
Attach to cloth Unity5 - How to pull cloth objects instead of push? 0 Answers