Truck and trailer attachment through a joint,any joint.

Hi, all im trying to make a 3d game in which a tractor with an attached trolley has to deliver goods from point A to point B. I have tried to attach a hinge joint to trailer but it keeps rotating itself, by its own. I dont even drive the tractor. How do i fix it? Im a noobie, so please tell me which joint to use? And what else to do?

Hi @Farooq .
There are few simple steps to accomplish what you are trying to do.

  1. Add a Hinge Joint Component to your trailer.

  2. Pass the Truck GameObject to the connected body property of the Hinge Joint.

  3. Set the Anchor Position (Its generally a point around which the trailer will rotate).

  4. Set the axis to 1 against which you want to rotate your trailer. And set the other two axis to 0.

  5. Check Use Limits Property.

  6. Give the Min Limit say -35.

  7. Give the Max Limit say 35.

  8. And last but not least don’t forget to uncheck the Use Gravity property of the Rigid Body of your trailer.

You can fine tune the rotation behaviour by tweaking the Drag and Angular Drag properties of Rigid Body of your trailer.

I hope this will solve your problem.