Help with 2.5D side scroller

Hi everyone, I’m inspired by Deer and boy to make a game with similar gameplay, I like how it’s mostly a side scroller but has moments where the path changes, it’s not always completely left to right. I’ll share a clip of an example. How can i achieve something this? Do i need the player following a spline?

I haven’t tried doing this in my 2.5D side project yet, but I imagine you’d just find closest point on a spline to player’s world loc, get that point’s direction, and feed it to move input or something. Maybe get the closest spline point in tick and set player x and y loc via interp so it doesn’t drift during non-input movement like falling or knockbacks?

(post deleted by author)