I'm working on a game that mixes 3D and 2D gameplay. For 2D, the character can move along a bezier spline, side-scroller style. He is not, however, entirely stuck to the path as he can jump and do air dashes. That said, a problem comes up when trying to get the current position and tangent to use on the spline. If the movement was entirely on the ground, simply adding the speed to the distance traveled would work however it is possible to skip entire parts of the spline thus rendering the whole method useless. In the picture below, if the character wall jumps his way through to the upper platform he can jump off and skip the whole pipe segment thus traveling a shorter distance. Of course, I tried just using the closest point on the spline but that's not reliable in figure 8 splines or this same situation even.
I would be so grateful if anyone could point me in the right direction.
(note: to keep the player aligned to the spline I get the position on the spline by distance and lerp his position there while keeping his Y untouched )
