Vehicle/Train physics like Dead Rails and The Wild West

hey guys, yk when ur on a vehicle and u jump, u fall off, the games Dead Rails and The Wild West seem to fix this somehow

i suppose they use a system where it raycasts your position to where you were on the part, and then when you move in a particular vector then it obtains that deviance and you move; think of what Jailbreak did on a similar system, i remember one of the devs told us about how it works in a forum post a very long time ago