How can I have instantiated objects snap together?

Hi. I want to create a system that allows players to race along an infinite abstract racetrack. My plan is to model several small sections of track (that all have similar end widths) and have them be placed end to end as the races through the environment. Imagine something like this, but placement of the track pieces would be dynamic. My issue is that I’m not sure on how to line up the track piece models so that they snap together. If it were all in a straight line it would be easy enough, but how do I take in the different rotations of the track into account? Thanks.

When I’ve done this, each track piece has anchor points consisting of a position and local rotation (or local forward vector), All you do is align the end anchor of the last piece, with the start anchor of the new piece