How can I make the player follow the curvature of a tunnel?

Dear All,
I am currently working on a 2D platforming game where one of the main mechanics is tunnelling in pre-made tunnels made by me (the developer) similar to the ones in the sonic franchise. I was wondering how I would be able to make the player move through the tunnels and follow the curvature of them?
Thank you very much,


Thank you very much @MerryLeo.

Hello @GreenPlanetGames,

I don’t know how the original Sonic tunnels were made, but I would suggest using a spline system. You would make a predefined path with a spline that the player would move along after entering the tunnel. Unity has a built-in class called EditablePath that you probably can use for that matter. There are also tons of useful videos like this one. I hope this helps!