0 votes
by
I'm working on a semi-trailer and need to attach the trailer to the tractor, but VPVehicleJoint doesn't seem to lock them together.

1 Answer

0 votes
by
edited by
 
Best answer

Quick guide to use VPVehicleJoint for attaching tractor + trailers:

  • Put the VPVehicleJoint component in the trailer, specifically in the Transform that will be the attachment point.
  • Configure "Other Anchor" with the Transform that will be the attachment point in the tractor.
  • Configure all linear constraints (X, Y, Z Motion) as Locked.
  • Configure the angular constraints X, Y (Angular X, Y Motion) as Free.
  • Configure the angular constraint Z (Angular Z Motion) as Locked.
  • The colliders in both parts should allow them to articulate at the junction point without contacting.

The VPVehicleJoint component may be disabled and re-enabled to detach / attach the trailer. Ensure that both attachment points are at the same world position before enabling the component. Otherwise, both parts will jump suddenly to join the attachment points.

...