Physics of machines

Let’s say this parenting structure for a machine with a lot of moving parts that all have to interact with physics in some way.
Like, for example, a telescopic boom crane. In the real world (running out of time to write this so please ignore the missing forces/inaccuracy in details, if that makes any sense.), the weight on the hook has a force that pulls down on the boom, and that makes leverage, which acts on the body of the crane, and if that weight was too much, it would tip the crane over. But modeling that in unity has been giving me trouble, it’s easy if everything was static, but the boom has sections that connect together for the telescoping, and those sections extend in and out of each other. The boom moves up and down, pivoting at the point where it connects to the crane base (also known as the superstructure or house), and it’s moved by a hydraulic cylinder. The house/base/superstructure sits ontop of a truck and rotates around it’s center on the y axis, etc, etc.

the parenting structure is easy enough
-Carrier/Truck
— Base/superstructure/house
-----Boom base section
-------Boom inner section 1
---------Boom inner section 2
-----------Boom end section with boom head
-Hook (connected with a joint to the boom head)

but my biggest problems are in the boom.
If I make the boom sections kinematic, then the weight on the hook won’t have any effect on the base, and the crane would never tip over.
If I make them non-kinematic, and use joints, the I have a problem with the forces the joints apply not being enough to stay stable when a load is attached to the hook. (when a load get’s attached, depending on the angle of the boom (relative to the base), either the sections slide back into each-other as the weight of the load starts to overcome the joint forces (when when the max force is infinity), or, the boom will start to sag/lower as the weight of the load pulls it down.)
I just can’t figure out how to move the boom around, without having the pesky physics engine cause odd behavior in the hydraulics, but then also still have any weight at the end of the boom still have leverage on the superstructure of the crane in a stable and reliable manner.

I’d just make everything but the hook to use static colliders, all them being child of the carrier’s rigidbody. You may then rotate, slide, etc. all them by scripting. The hook using a joint connection will still cause all the physics effects you expect in the crane.

1 Like

I take it the joint for the hook would connect to the rigidbody of the carrier, but the anchor position would have to be updated every frame to the position of the boom tip. Does updating the anchor position constantly like that have any negative effect?

Right. There shouldn’t be any adverse effect. I only have done some limited tests though, but I haven’t noticed any issue.