Spline Sliding System Offset Problem

Hi guys,

I am currently trying a sliding system based on Star Wars Fallen Order:

I built a spline and the character follows the spline. I needed an offset in Z so that the character was on the spline.

So how do I make sure that the offset in relation to the spline always remains correct?

But as soon as the route (spline) goes uphill, the offset no longer fits and the character slips through the spline mesh.
This happens because the character changes its rotation when the distance changes in the Z axis.

Demonstration:

So how do I make sure that the offset in relation to the spline always remains correct?