Q: Make connected objects, e.g. mobiles, chain, seesaw, using physics engine?

Dear Processing folks,
I’m a math teacher, and am playing around with trying to make math games in p5js and p5.play. Here’s what I’ve got so far: a math version of Candy Crush:
https://rajeevraizada.github.io/rajmathgame/

I would like to make something a bit like this: SolveMe Mobiles
but with actual hanging and swinging mobiles, and objects that behave like real hanging weights using a physics engine. It seems to me that the sprites and physics engine in p5.play would be great for this.

However, the key piece of such a project would be having objects physically linked, e.g. chains supporting buckets, with the chains hanging from a link. My question is: how do I make two objects physically linked, so that one can hang from the other?

It’s easy to make one object physically sit on top of another, but it’s not clear to me how to make one hang from or hinged to another, like a chain hanging from a link, or a seesaw fulcrum. I strongly expect that there’s a nice solution already existing, so I figured I’d ask!

Any help greatly appreciated,

Raj