Issue with trailer reversing in Jourverse AI Vehicle tutorial

**


,**

I am following the AI Vehicle tutorial by Jourverse to make a truck with a trailer follow a spline. I am using the City Sample Vehicle and have encountered an issue when reversing the truck with the trailer.

Problem:

When the truck reverses, the trailer doesn’t follow the spline properly. The trailer bends incorrectly and doesn’t stay on the path it should.

Attempts to solve the issue:

I’ve tried modifying the Constraint Trailer to make it more rigid when reversing, but this causes the trailer not to turn correctly and doesn’t fix the problem.

Possible solution:

I was thinking that a possible solution could be to make the trailer rotate from the rear wheels when the truck reverses, so it follows the spline properly. However, I’m not sure how to implement this.

Request for help:

I would greatly appreciate any help or solutions you can offer.

Thank you in advance.

This happens because the vehicle AI component only controls the vehicle body, while the trailer’s movement is governed by physics. A more complex system is required to understand the situation and make adjustments accordingly. When reversing, the vehicle head of the semi-truck pushes the trailer. You need to track the trailer’s direction so the vehicle can make turning angle calculation to push it to the desired location. https://youtu.be/-wVobD4Juhc?si=qxcXWl4T2tkxovWf