Object colliding with collider junction instead of sliding over it

Hi!

I’m trying to make a train follow a rail, and I decided to do it with physics.

My train has each whell as a separate object, and each of these has a capsule collider in the side of the wheel to prevent it from derailing. On the top of that, I have a wheel collider on another object put on every wheel, to keep it on the top of the rails, as seen in the pictures below.

My rails on the other hand also have two colliders, one for every rail (on the same object).

To move the trail I made a really simple script, where I basically apply a specific torque to the wheel colliders.

    private void FixedUpdate()
    {
        float torque = motorTorque * forwardInput;
        foreach(WheelCollider wheel in wheels)
        {
            wheel.motorTorque = torque;
        }
        Debug.Log(GetComponent<Rigidbody>().velocity);
    }

Now, when the train starts moving, it does it great until reaching the end of each rail piece. In that moment it stops like it’s crashed with a wall, unless the speed is enough to make the train go beyond the collision, but still colliding.

This is showcased here: Unity Train collider problem - YouTube

Any ideas of what is causing such behaviour or any ideas on how to solve it?

Thanks!

In that case, applying collisions and physics would be a bad choice. A better way would be to place markers above the tracks and command the vehicle to follow them. sorry for my English