I have a bridge which was created using cubes (as rigidbodies) and cylinders x2 (as hinge joints to support the cube on both sides. Each cylinder has 2 hinge joints, each for the 2 cubes it connects too.
anyways. everything works well enough, except, when my 50 kg character stands still or jumps onto a cube, the force is clearly too great, and the cubes stretch away from the hinge joint and eventually spring back into play launching my character a million km into the atmosphere where physics doesnt bother me anymore.
looking at configurable joints, but they also stretch under force, even when motion and angular motion locked. Maybe the way im doing the joints are incorrect, and the cubes, themselves, need configurable joints to the hinge joints objects, so rb joints connected directly to rb joints?
Just need the cubes and/ or the joints to sit still and truly act like they are connected.
any help is greatly appreciated. also, i have tried limits, and springs, but they only help to a certain extent.
You’ve discovered what is just the reality about how joints in general function, or one might say don’t. There’s only so much that can be done. PhysX, the engine under the hood, offers articulated joints which do much better, but they aren’t exposed in Unity at this time.
When a Hinge is used as the axle for a wheel, the vehicle one might use them for will not withstand much mass (weight) without dislodging the wheel, as if the axle buckles under weight. When used for a door, if the door is hit with significant force, it’s as if the axles are bent or dislodged. These results happen despite the breakage value set to infinity.
To use these hinges the only option is to reduce the mass of the objects affecting the hinge. In the case of a “door” like arrangement I have managed to build a kind of monitor that checks for misalignment and resets the artwork (the GameObject the hinge operates) when observed, but the result is a tad jittery.
It is typical that masses aren’t given as real mass, but mass values which at least function within the limits of the system, producing the general appearance expected. Games aren’t real physical simulations anyway. Physics engines like PhysX work with floats, and the intermediate calculations required for real time simulation can overflow or underflow floats all too easily, so the limits involved translate into non-realistic measurements which happen to produce reasonably realistic results, give or take.
Based on a guess about your scenario, my guess is that 5Kg would probably work, while 15Kg might be the limit at which you see the objectionable behavior. I’ve laughed myself at some of the strange results that can happen while tuning. I had a robot arm inflict so much power on the floor that it launched the bot into the air, and for a few moments while I wondered what happened I could see the shadow spinning until the bot fell back to the ground, twitching and bouncing, tossing objects everywhere like a 60’s cartoon. It was hilarious at the moment.