Spline-based rail grinding

So I’m working on a Sonic fan game using Hedge Physics, and the rail grinding included was never fully implemented and is not only incredibly buggy but also waypoint-based. What I’d like to accomplish is something more spline-based, where A) the player follows the spline at a certain speed going either direction, and B) the player can jump off of the rail at will.

I’m not asking for a full script, I just need a good spline asset (preferrably free or cheap) and somewhere to start on the actual grinding.

So I’m here to get some grind rail ideas, and since it’s been quite a few months since you posted this, I am wondering if you have found a solution.
Additionally, I have played around with some grind rail mechanics, and would like to share what I have discovered if you are still wondering/ working on this part of the project. I used “Surge” Splines (it has a bunch of different free features, but the Splines extension is the only one I downloaded). I gave each spline an edge collider, and a sub-object called “playerDock”. I set it so the dock moved along the rail, and the player had its transform set equal to the transform of the dock. It works, It feels like it’s a messy way to do it. So I’m asking around to see if anyone has any better ideas. :slight_smile:

Hi @GarryGuertena and @MadboyJames

You can use spline-based procedural geometry. This means that you also can generate the right mesh collider for your geometry.

It’s explained in detail in this video:


I’m pretty sure that you can download the code if you don’t want to write it yourself.

Good luck with your games!