How to Attach Truck with Trailer Like in Truck Parking Game?

Hello Friends,

I am developing a Truck Parking 3D android game. Everything i have created like Driving Truck with the help of Onscreen Steering wheel with option to Drive in Front and Reverse Gear.

Now i want to achieve - There will be a Rigid-body Trailer Vehicle standing in Play area. The player has to attach the Truck from behind with Trailer Vehicle. This should happen in run time in Unity. We can attach two ridbodies directly using HingeJoint or FixedJoint to give real life effect. There should be an intermediate object that will connect the two in efficient manner. Please help me how to achieve this.

Below is the image reference what type of attachment i am talking about.


Thanks in Advance.

I assume that you already have the 2 parts of the truck, The front and the trailer. Add rigidbody to both of them and only in the trailer add hinge joint also in physics below rigidbody. Now you have to play around with it to achieve what you want. In my case, I used hinge joint for doors and it worked fine.