Connected physics bodies

is there anyway to tell if two physics bodies or connected? For example say I have body1 welded to body2 welded to body3. Can I easily know that body3 is connected to body1 and body2?

@JakAttak The way I do this is store all joints in a table (same way I store all physics bodies in a table) then use joint.bodyA and joint.bodyB. But I’ve asked for an addition to physics.joint being physics.joint.info to store arbitrary information the same way physics.body.info does, as then it’s possible to store an ID to differentiate between them.

@Luatee, thanks. I’ll try this solution.