Attach gameobject to multiple gameobjects

Hello everyone,

I am currently trying to “nail” a gameobject to 2 different gameobjects. Just like steam trains where wheels are joined together with a rod. I know how to link this rod to one of the wheels and make it turn around it but when I want to link the other side of the rod to the other wheel, it’s a bit more complicated.

I also did try with one link and a script on the rod saying turn the opposite way, which makes it stay horizontal like I want but again it’s quite tricky, knowing that I want it to follow the wheel’s circumference at the same speed.

Any easier way to do the trick ?
I thank you for your help !

Take a look at using joints