How to temporarily restrict third person character's movement? Like for walking on a plank

So, this is something commonly found in third person games. You can move around freely, but then you go find a plank or a ledge on a cliff and you have your movement constrained (with special animation for such movement) for the given path.

Like in this example from Hellblade: - YouTube

You walk up to the start of the path, in this case a plank, and when you get to a certain distance, you restrict the movement to along the path of the plank. I need this plank to be custom path too, not just a straight line.

I looked into the spline based movement klonoa/pandemonium thing but it seems that only works for moving right or left as the movement is controlled by distance in spline to right and left movement input, while in such a free moving third person character game, your camera direction determines the movement input direction. Furthermore, there seems to be a bit of a snap when you force-move the character to the spline position. So, I guess this is not exactly how this sort of movement was done?

Any ideas on how to achieve this sort of thing?

Thanks